-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.js
executable file
·87 lines (83 loc) · 2.47 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import path from 'path';
import babel from '@babel/core';
import { FlatCompat } from '@eslint/eslintrc';
import flowPlugin from 'eslint-plugin-flowtype';
import globals from 'globals';
import { rootResolve } from './shared/utils.js';
const { code: webpack } = await (babel.transformFileAsync(
path.resolve(rootResolve(), '.storybook/webpack.config.js'),
));
const compat = new FlatCompat();
export default [
...compat.config({
...flowPlugin.configs.recommended,
parser: '@babel/eslint-parser',
}),
...compat.extends('airbnb', 'plugin:storybook/recommended'),
...compat.plugins('flowtype', 'jest'),
{
languageOptions: {
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
babelOptions: {
configFile: './babel.config.common.cjs',
},
},
globals: {
...globals.jest,
...globals.browser,
},
},
rules: {
'import/no-extraneous-dependencies': 0,
'import/no-webpack-loader-syntax': 0,
'import/extensions': ['error', 'ignorePackages'],
'import/no-duplicates': ['error', { considerQueryString: true }],
'no-confusing-arrow': ['error', { allowParens: true }],
'arrow-parens': ['error', 'as-needed'],
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx'] }],
'react/jsx-props-no-spreading': 0,
'react/prefer-exact-props': 0,
'react/static-property-placement': ['warn', 'static public field'],
'react/no-multi-comp': 0,
'react/function-component-definition': 0,
'no-restricted-exports': 0,
'import/prefer-default-export': 0,
'object-curly-newline': ['error', { consistent: true }],
'no-bitwise': ['error', { int32Hint: true }],
'no-mixed-operators': 0,
},
settings: {
'import/parsers': {
'@babel/eslint-parser': ['.js', '.cjs', '.mjs', '.jsx'],
},
'import/resolver': {
node: {
moduleDirectory: ['./'],
},
webpack,
alias: [
['@psychobolt/react-rollup-boilerplate', './src/index.js'],
['@psychobolt/default-export', './packages/default-export/src/index.js'],
],
},
},
},
{
ignores: [
'.yarn/',
'coverage/',
'flow-deps-modules/',
'packages/react-cache',
'**/dist/',
'shared/flow-typed/npm/',
'storybook-static/',
'.pnp.cjs',
'.pnp.loader.mjs',
],
},
];