ToolJet/frontend/.eslintrc.js
2022-09-01 16:49:23 +05:30

72 lines
1.5 KiB
JavaScript

module.exports = {
env: {
browser: true,
amd: true,
es2021: true,
node: true,
'jest/globals': true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:prettier/recommended',
],
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
babelOptions: {
configFile: __dirname + '/babel.config.js',
},
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', 'prettier', 'jest'],
rules: {
'prettier/prettier': [
'error',
{
semi: true,
trailingComma: 'es5',
printWidth: 120,
singleQuote: true,
arrowParens: 'always',
proseWrap: 'preserve',
},
],
'react/prop-types': 0,
'react/display-name': 'off',
'no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'react/no-deprecated': 0,
'no-prototype-builtins': 0,
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
settings: {
react: {
version: 'detect',
},
'import/resolver': 'webpack',
},
globals: {
path: true,
fetch: true,
process: true,
module: true,
__dirname: true,
},
};