Skip to content

Commit

Permalink
chore: sort json (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx authored Jan 10, 2025
1 parent 9de154b commit 5c2bd9b
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 51 deletions.
14 changes: 7 additions & 7 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"printWidth": 120,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"endOfLine": "auto",
"arrowParens": "avoid",
"endOfLine": "auto",
"overrides": [
{
"files": "*.json",
"options": {
"printWidth": 80
}
}
]
],
"printWidth": 120,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "all"
}
66 changes: 37 additions & 29 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,46 @@ import jsEslint from "@eslint/js";
import gitignore from "eslint-config-flat-gitignore";
import eslintConfigPrettier from "eslint-config-prettier";
import importX from "eslint-plugin-import-x";
import jsonc from "eslint-plugin-jsonc";
import perfectionist from "eslint-plugin-perfectionist";
import tsEslint from "typescript-eslint";

export default tsEslint.config(
jsEslint.configs.recommended,
...tsEslint.configs.recommended,
eslintConfigPrettier,
importX.flatConfigs.recommended,
perfectionist.configs["recommended-natural"],
gitignore(),
eslintConfigPrettier,
{
extends: [
jsEslint.configs.recommended,
...tsEslint.configs.recommended,
importX.flatConfigs.recommended,
perfectionist.configs["recommended-natural"],
],
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
languageOptions: {
ecmaVersion: "latest",
globals: {
console: true,
process: true,
},
parser: tsEslint.parser,
sourceType: "module",
},
rules: {
"prefer-const": "off",
"sort-imports": "off",
plugins: {
"@typescript-eslint": tsEslint.plugin,
},
},
{
rules: {
"@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }],
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
varsIgnorePattern: "^_",
},
],
"import-x/consistent-type-specifier-style": ["error", "prefer-inline"],
"import-x/no-duplicates": ["error", { considerQueryString: true, "prefer-inline": true }],
"import-x/no-unresolved": "off",
Expand All @@ -46,29 +60,23 @@ export default tsEslint.config(
],
},
],
"prefer-const": "off",
"sort-imports": "off",
},
},
{
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
languageOptions: {
parser: tsEslint.parser,
},
plugins: {
"@typescript-eslint": tsEslint.plugin,
},
extends: [...jsonc.configs["flat/recommended-with-json"]],
files: [
"src/**/*.json",
"scripts/**/*.json",
"tsconfig.json",
".prettierrc.json",
".prettierrc",
"typedoc.json",
"mangle-cache.json",
],
rules: {
"@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }],
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
varsIgnorePattern: "^_",
},
],
"jsonc/sort-keys": ["error", "asc", { caseSensitive: true, minKeys: 2, natural: true }],
},
},
);
159 changes: 159 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"eslint-config-flat-gitignore": "^0.3.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import-x": "^4.6.1",
"eslint-plugin-jsonc": "^2.18.2",
"eslint-plugin-perfectionist": "^4.6.0",
"gzip-size": "^7.0.0",
"prettier": "^3.4.2",
Expand Down
19 changes: 10 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"compilerOptions": {
"declaration": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"lib": ["DOM", "ESNext"],
"module": "ESNext",
"moduleResolution": "Node",
"noFallthroughCasesInSwitch": true,
"noUnusedParameters": true,
"noImplicitOverride": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"noUnusedParameters": true,
"outDir": "dist",
"resolveJsonModule": true,
"lib": ["DOM", "ESNext"],
"outDir": "dist"
"skipLibCheck": true,
"strict": true,
"stripInternal": true,
"target": "ESNext"
},
"include": ["src/**/*"]
}
12 changes: 6 additions & 6 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["./src/index.ts"],
"out": "docs",
"cleanOutputDir": true,
"customCss": "./assets/docs.css",
"visibilityFilters": {},
"entryPoints": ["./src/index.ts"],
"excludeInternal": true,
"excludePrivate": true,
"excludeProtected": true,
"excludeInternal": true,
"cleanOutputDir": true,
"hideGenerator": true,
"includeVersion": true,
"hideGenerator": true
"out": "docs",
"visibilityFilters": {}
}

0 comments on commit 5c2bd9b

Please sign in to comment.