-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split off eslintConfig from package.json into .eslintrc.cjs (#2740)
- Loading branch information
1 parent
3b54858
commit 8f9788c
Showing
5 changed files
with
85 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
jest: true, | ||
}, | ||
extends: [ | ||
"plugin:react/recommended", | ||
"plugin:react/jsx-runtime", | ||
"plugin:react-hooks/recommended", | ||
"plugin:import/recommended", | ||
], | ||
ignorePatterns: ["*.dic.js"], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
ecmaFeatures: { jsx: true }, | ||
project: "./tsconfig.json", | ||
}, | ||
plugins: ["@typescript-eslint", "react", "unused-imports"], | ||
root: true, | ||
rules: { | ||
"import/first": "warn", | ||
"import/newline-after-import": "warn", | ||
"import/no-duplicates": "warn", | ||
"import/no-named-as-default": "off", | ||
"import/no-named-as-default-member": "off", | ||
"import/order": [ | ||
"warn", | ||
{ | ||
alphabetize: { order: "asc" }, | ||
groups: [ | ||
"builtin", | ||
"external", | ||
["internal", "parent", "sibling", "index", "object", "type"], | ||
], | ||
"newlines-between": "always", | ||
}, | ||
], | ||
"no-undef": "off", | ||
"prefer-const": "warn", | ||
"react/jsx-boolean-value": "warn", | ||
"unused-imports/no-unused-imports": "warn", | ||
}, | ||
settings: { | ||
react: { version: "detect" }, | ||
"import/resolver": { | ||
typescript: { alwaysTryTypes: true }, | ||
}, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["*.ts", "*.tsx"], | ||
extends: [ | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:import/typescript", | ||
], | ||
rules: { | ||
"@typescript-eslint/explicit-function-return-type": [ | ||
"warn", | ||
{ allowExpressions: true }, | ||
], | ||
"@typescript-eslint/no-empty-interface": "warn", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-inferrable-types": "warn", | ||
"@typescript-eslint/no-unused-vars": "warn", | ||
"@typescript-eslint/switch-exhaustiveness-check": "warn", | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true, | ||
"baseUrl": "src", | ||
"downlevelIteration": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"isolatedModules": true, | ||
"jsx": "react-jsx", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "react-jsx", | ||
"downlevelIteration": true, | ||
"baseUrl": "src", | ||
"noFallthroughCasesInSwitch": true | ||
"noFallthroughCasesInSwitch": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"target": "es5" | ||
}, | ||
"exclude": ["*.dic.js"], | ||
"include": ["src", "scripts"] | ||
"include": [".eslintrc.cjs", "src", "scripts"] | ||
} |