This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
.eslintrc.cjs
50 lines (50 loc) · 1.56 KB
/
.eslintrc.cjs
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
/* eslint-env node */
module.exports = {
reportUnusedDisableDirectives: true,
overrides: [
{
files: '*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'prettier',
],
parser: '@typescript-eslint/parser',
rules: {
'object-shorthand': ['error', 'always'],
'no-else-return': ['error', { allowElseIf: false }],
'react/jsx-curly-brace-presence': ['error', 'never'],
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
// eslint has wrong import path resolution and also doesn't seem to find regular dependencies
'import/no-unresolved': 'off',
// There are legitimate reasons some types are set as "any" for easier usage
'@typescript-eslint/no-explicit-any': 'off',
// This is an arbitrary and useless rule
'react/no-children-prop': 'off',
'react/react-in-jsx-scope': 'off',
},
settings: {
react: {
version: 'detect',
},
},
},
{
files: ['.eslintrc.js', 'scripts/*', 'next.config.mjs', 'postcss.config.{js,cjs}', 'tailwind.config.cjs'],
env: {
node: true,
},
},
{
files: 'examples/**/*',
rules: {
'react/react-in-jsx-scope': 'off', // no need for NextJS
},
},
],
};