fix: turn off react-in-jsx-scope rule (#317)

This commit is contained in:
Dan Orlando 2023-05-18 12:12:19 -07:00 committed by GitHub
parent a17b878617
commit 47533736e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 50 deletions

View file

@ -22,6 +22,7 @@ module.exports = {
}, },
plugins: ['react', 'react-hooks', '@typescript-eslint'], plugins: ['react', 'react-hooks', '@typescript-eslint'],
rules: { rules: {
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }], '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
indent: ['error', 2, { SwitchCase: 1 }], indent: ['error', 2, { SwitchCase: 1 }],
'max-len': [ 'max-len': [

View file

@ -4,80 +4,79 @@ module.exports = {
es2021: true, es2021: true,
node: true, node: true,
commonjs: true, commonjs: true,
es6: true, es6: true
}, },
extends: [ extends: ['prettier'],
"prettier",
],
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
parserOptions: { parserOptions: {
ecmaVersion: "latest", ecmaVersion: 'latest',
sourceType: "module", sourceType: 'module',
ecmaFeatures: { ecmaFeatures: {
jsx: true, jsx: true
}
}, },
}, plugins: ['react', 'react-hooks', '@typescript-eslint'],
plugins: ["react", "react-hooks", "@typescript-eslint"],
rules: { rules: {
indent: ["error", 2, { SwitchCase: 1 }], 'react/react-in-jsx-scope': 'off',
"max-len": [ indent: ['error', 2, { SwitchCase: 1 }],
"error", 'max-len': [
'error',
{ {
code: 150, code: 150,
ignoreStrings: true, ignoreStrings: true,
ignoreTemplateLiterals: true, ignoreTemplateLiterals: true,
ignoreComments: true, ignoreComments: true
}, }
], ],
"linebreak-style": 0, 'linebreak-style': 0,
"arrow-parens": [2, "as-needed", { requireForBlockBody: true }], // 'arrow-parens': [2, 'as-needed', { requireForBlockBody: true }],
// 'no-plusplus': ['error', { allowForLoopAfterthoughts: true }], // 'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
"no-console": "off", 'no-console': 'off',
"import/extensions": "off", 'import/extensions': 'off',
"no-promise-executor-return": "off", 'no-promise-executor-return': 'off',
"no-param-reassign": "off", 'no-param-reassign': 'off',
"no-continue": "off", 'no-continue': 'off',
"no-restricted-syntax": "off", 'no-restricted-syntax': 'off',
"react/prop-types": ["off"], 'react/prop-types': ['off'],
"react/display-name": ["off"], 'react/display-name': ['off']
}, },
overrides: [ overrides: [
{ {
files: ["**/*.ts", "**/*.tsx, **/*.js, **/*.jsx"], files: ['**/*.ts', '**/*.tsx, **/*.js, **/*.jsx'],
rules: { rules: {
"no-unused-vars": "off", // off because it conflicts with '@typescript-eslint/no-unused-vars' 'no-unused-vars': 'off', // off because it conflicts with '@typescript-eslint/no-unused-vars'
"react/display-name": "off", 'react/display-name': 'off',
"@typescript-eslint/no-unused-vars": "warn", '@typescript-eslint/no-unused-vars': 'warn'
}, }
}, },
{ {
files: ["rollup.config.js", ".eslintrc.js", "jest.config.js"], files: ['rollup.config.js', '.eslintrc.js', 'jest.config.js'],
env: { env: {
node: true, node: true
}, }
}, },
{ {
files: [ files: [
"**/*.test.js", '**/*.test.js',
"**/*.test.jsx", '**/*.test.jsx',
"**/*.test.ts", '**/*.test.ts',
"**/*.test.tsx", '**/*.test.tsx',
"**/*.spec.js", '**/*.spec.js',
"**/*.spec.jsx", '**/*.spec.jsx',
"**/*.spec.ts", '**/*.spec.ts',
"**/*.spec.tsx", '**/*.spec.tsx',
"setupTests.js", 'setupTests.js'
], ],
env: { env: {
jest: true, jest: true,
node: true, node: true
}, },
rules: { rules: {
"react/display-name": "off", 'react/display-name': 'off',
"react/prop-types": "off", 'react/prop-types': 'off',
"react/no-unescaped-entities": "off", 'react/no-unescaped-entities': 'off'
}, }
}, }
], ],
settings: { settings: {
react: { react: {
@ -85,7 +84,7 @@ module.exports = {
// default to "createReactClass" // default to "createReactClass"
pragma: 'React', // Pragma to use, default to "React" pragma: 'React', // Pragma to use, default to "React"
fragment: 'Fragment', // Fragment to use (may be a property of <pragma>), default to "Fragment" fragment: 'Fragment', // Fragment to use (may be a property of <pragma>), default to "Fragment"
version: 'detect', // React version. "detect" automatically picks the version you have installed. version: 'detect' // React version. "detect" automatically picks the version you have installed.
}, }
}, }
}; };