Skip to content

Commit

Permalink
feat: v3
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
- remove lib, dist from ignorePatterns
- add mts,cts extensions
- add sort require/import rules
  • Loading branch information
skarab42 committed Nov 27, 2022
1 parent 744698f commit 0dc74ba
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 102 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"overrides": [
{
"files": ["**/*.{js,cjs,mjs}"],
"files": ["**/*.{js,cjs,mjs,jsx}"],
"extends": ["./rc/javascript", "prettier"]
},
{
"files": ["**/*.{ts,tsx}"],
"files": ["**/*.{ts,cts,mts,tsx}"],
"extends": ["./rc/typescript", "prettier"]
},
{
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.3.0",
"eslint-plugin-no-only-tests": "^3.0.0",
"eslint-plugin-no-use-extend-native": "^0.5.0",
"eslint-plugin-promise": "^6.0.1",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint-plugin-sort-requires": "^2.1.0",
"eslint-plugin-unicorn": "^43.0.2"
},
"devDependencies": {
Expand Down
80 changes: 16 additions & 64 deletions pnpm-lock.yaml

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

27 changes: 8 additions & 19 deletions rc/javascript.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"$schema": "https://json.schemastore.org/eslintrc",
"extends": [
"eslint:recommended",
"plugin:unicorn/recommended",
"plugin:import/recommended",
"plugin:n/recommended",
"plugin:import/recommended",
"plugin:promise/recommended",
"plugin:no-use-extend-native/recommended"
"plugin:unicorn/recommended"
],
"plugins": ["sort-requires", "simple-import-sort"],
"env": {
"node": true,
"es2022": true
Expand All @@ -20,20 +20,11 @@
}
},
"reportUnusedDisableDirectives": true,
"ignorePatterns": [
"__snapshots__",
"node_modules",
"coverage",
"dist",
"lib",
"package-lock.json",
"pnpm-lock.yaml",
"yarn.lock"
],
"ignorePatterns": ["__snapshots__", "node_modules", "coverage", "package-lock.json", "pnpm-lock.yaml", "yarn.lock"],
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".mjs"]
"extensions": [".js", ".cjs", ".mjs", ".jsx"]
}
}
},
Expand All @@ -42,10 +33,8 @@
"no-console": "warn",
"no-debugger": "warn",
"import/namespace": "off",
"import/default": "off",
"import/export": "off",
"import/named": "off",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off"
"sort-requires/sort-requires": "warn",
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn"
}
}
14 changes: 6 additions & 8 deletions rc/typescript.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,29 @@
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module",
"project": ["./tsconfig.json", "./tsconfig.*.json"]
"project": ["**/tsconfig.json", "**/tsconfig.*.json"]
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
"@typescript-eslint/parser": [".ts", ".cts", ".mts", ".tsx"]
},
"import/resolver": {
"node": {
"extensions": [".ts", ".tsx"]
},
"typescript": {
"alwaysTryTypes": true
"alwaysTryTypes": true,
"extensions": [".ts", ".cts", ".mts", ".tsx"]
}
}
},
"rules": {
"etc/no-t": "error",
"etc/no-const-enum": "error",
"etc/no-misused-generics": "warn",
"n/no-unsupported-features/es-syntax": "off",
"@typescript-eslint/no-throw-literal": "error",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"dot-notation": "off",
"@typescript-eslint/dot-notation": ["error", { "allowIndexSignaturePropertyAccess": true }],
"n/no-unsupported-features/es-syntax": "off"
"@typescript-eslint/dot-notation": ["error", { "allowIndexSignaturePropertyAccess": true }]
}
}
8 changes: 0 additions & 8 deletions tsconfig.json

This file was deleted.

0 comments on commit 0dc74ba

Please sign in to comment.