-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
355 additions
and
643 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,206 @@ | ||
import * as parser from '@typescript-eslint/parser' | ||
import {fixupPluginRules} from '@eslint/compat' | ||
import eslintConfigPrettier from 'eslint-config-prettier' | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' | ||
import jsxA11y from 'eslint-plugin-jsx-a11y' | ||
import eslintPluginReactHooks from 'eslint-plugin-react-hooks' | ||
import eslintPluginReact from 'eslint-plugin-react' | ||
import eslintPluginGithub from 'eslint-plugin-github' | ||
import eslintPluginTypescript from 'typescript-eslint' | ||
// import {plugins} from 'eslint-plugin-react/configs/all' | ||
// "eslint-plugin-primer-react": "^5.3.0", | ||
// "eslint-import-resolver-typescript": "3.6", | ||
|
||
export default [ | ||
// 'plugin:github/recommended', | ||
// 'plugin:github/browser', | ||
// { | ||
// plugins: { | ||
// react: eslintPluginReact, | ||
// 'react-hooks': fixupPluginRules(eslintPluginReactHooks), | ||
// }, | ||
// rules: { | ||
// ...eslintPluginGithub.rules | ||
// }, | ||
// }, | ||
jsxA11y.flatConfigs.recommended, | ||
{ | ||
plugins: { | ||
react: eslintPluginReact, | ||
'react-hooks': fixupPluginRules(eslintPluginReactHooks), | ||
}, | ||
rules: { | ||
...eslintPluginReactHooks.configs.recommended.rules, | ||
...eslintPluginReact.configs['jsx-runtime'].rules, | ||
}, | ||
}, | ||
eslintPluginPrettierRecommended, | ||
eslintConfigPrettier, | ||
{ | ||
ignores: ['node_modules', 'coverage/**', 'docs/**', 'dist/**/*', 'CHANGELOG.md', 'src/@types/'], | ||
}, | ||
{ | ||
languageOptions: { | ||
parser, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
globals: { | ||
__DEV__: 'readonly', | ||
browser: true, | ||
commonjs: true, | ||
es6: true, | ||
jest: true, | ||
node: true, | ||
}, | ||
}, | ||
ignores: ['README.md'], | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
'import/resolver': { | ||
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint | ||
}, | ||
}, | ||
// rules which apply to JS, TS, etc. | ||
rules: { | ||
'filenames/match-regex': 0, | ||
'eslint-comments/no-unused-disable': 0, | ||
'react/prop-types': 0, | ||
'react/display-name': 0, | ||
'react-hooks/exhaustive-deps': 'error', | ||
'jsx-a11y/label-has-for': [ | ||
2, | ||
{ | ||
components: [], | ||
}, | ||
], | ||
camelcase: [ | ||
'error', | ||
{ | ||
allow: [ | ||
'light_high_contrast', | ||
'light_colorblind', | ||
'light_tritanopia', | ||
'dark_dimmed', | ||
'dark_high_contrast', | ||
'dark_colorblind', | ||
'dark_tritanopia', | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
// rules which apply only to JS | ||
{ | ||
files: ['**/*.{js,jsx}'], | ||
rules: { | ||
'eslint-comments/no-use': 0, | ||
'import/no-namespace': 0, | ||
'no-shadow': 0, | ||
'import/no-commonjs': 0, | ||
'import/no-nodejs-modules': 0, | ||
'no-unused-vars': [ | ||
'error', | ||
{ | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
plugins: { | ||
eslintPluginTypescript: eslintPluginTypescript.configs.recommended, | ||
}, | ||
files: ['**/*.{ts,tsx}'], | ||
}, | ||
// rules which apply only to TS | ||
{ | ||
languageOptions: { | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
}, | ||
}, | ||
files: ['**/*.{ts,tsx}'], | ||
// extends: ['plugin:@typescript-eslint/recommended', 'prettier'], | ||
rules: { | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': 'error', | ||
'@typescript-eslint/no-explicit-any': 2, | ||
'@typescript-eslint/no-unnecessary-condition': 2, | ||
'@typescript-eslint/explicit-module-boundary-types': 0, | ||
'@typescript-eslint/consistent-type-imports': 'warn', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ | ||
argsIgnorePattern: '^_', | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
// rules which apply only to tests files | ||
{ | ||
files: ['**/*.test.{ts,tsx,js,jsx}'], | ||
rules: { | ||
'i18n-text/no-en': 0, | ||
}, | ||
}, | ||
// // rules which apply only to TS scripts | ||
// { | ||
// files: ['scripts/**/*.ts', 'src/**/*.ts'], | ||
// rules: { | ||
// 'import/no-nodejs-modules': [ | ||
// 'error', | ||
// { | ||
// allow: ['path', 'fs', 'fs/promises'], | ||
// }, | ||
// ], | ||
// 'i18n-text/no-en': 0, | ||
// }, | ||
// }, | ||
// // rules which apply only to Markdown | ||
// { | ||
// files: ['**/*.{md,mdx}'], | ||
// extends: ['plugin:mdx/recommended'], | ||
// settings: { | ||
// 'mdx/code-blocks': true, | ||
// }, | ||
// rules: { | ||
// 'prettier/prettier': 0, | ||
// }, | ||
// }, | ||
// rules which apply only to Markdown code blocks | ||
{ | ||
files: ['**/*.{md,mdx}/**'], | ||
languageOptions: { | ||
parserOptions: { | ||
project: false, | ||
}, | ||
}, | ||
rules: { | ||
camelcase: 0, | ||
'import/no-unresolved': 0, | ||
'no-constant-condition': 0, | ||
'no-console': 0, | ||
'no-empty-pattern': 0, | ||
'no-unused-vars': 0, | ||
'no-undef': 0, | ||
'react/no-unescaped-entities': 0, | ||
'react/react-in-jsx-scope': 0, | ||
'react/jsx-no-undef': 0, | ||
'react/jsx-key': 0, | ||
'react/jsx-no-comment-textnodes': 0, | ||
'i18n-text/no-en': 0, | ||
'import/no-anonymous-default-export': 0, | ||
'import/extensions': 0, | ||
'prettier/prettier': 0, | ||
'@typescript-eslint/no-unnecessary-condition': 0, | ||
'@typescript-eslint/no-unused-vars': 0, | ||
'no-redeclare': 0, | ||
}, | ||
}, | ||
] |
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
Oops, something went wrong.