Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
57 lines (56 loc) · 1.49 KB
/
Copy patheslint.config.js
File metadata and controls
57 lines (56 loc) · 1.49 KB
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
// ESLint flat config (ESLint 9). Same intent as the previous .eslintrc-style
// config: eslint:recommended + @typescript-eslint recommended + react
// recommended + react-hooks recommended.
const js = require('@eslint/js');
const globals = require('globals');
const tsPlugin = require('@typescript-eslint/eslint-plugin');
const reactPlugin = require('eslint-plugin-react');
const reactHooksPlugin = require('eslint-plugin-react-hooks');
module.exports = [
{
ignores: [
'dist/**',
'storybook-static/**',
'node_modules/**',
'example/**',
'*.config.js',
'*.config.ts',
],
},
js.configs.recommended,
...tsPlugin.configs['flat/recommended'],
reactPlugin.configs.flat.recommended,
reactHooksPlugin.configs['recommended-latest'],
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.es2021,
...globals.node,
},
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
// warn, not error: ~40 pre-existing `any`s; typing them properly is a separate change.
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_' },
],
},
},
];