This repository has been archived by the owner on Nov 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.cjs
86 lines (83 loc) · 2.28 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
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
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
ignorePatterns: [
'dist/**',
'build/**',
'node_modules/**',
// Auto generated for (s)css modules in TS. They use a naming convention thats different, so ideal to ignore them
'**/*.scss.d.ts',
'**/*.css.d.ts',
// Excludes css from being validating. Remove if adding css support
'**/*.scss',
'**/*.css',
// Image files dont need parsing
'**/*.svg',
'**/*.jpg',
'**/*.jpeg',
'**/*.png',
'**/*.webm',
],
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
extends: [
'eslint:recommended',
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:prettier/recommended',
],
rules: {
'require-jsdoc': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': 'warn',
semi: ['error', 'always'],
'react/react-in-jsx-scope': 0,
'react/jsx-uses-react': 0,
},
},
{
files: ['**/*.js', '**/*.jsx'],
extends: [
'eslint:recommended',
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:prettier/recommended',
],
rules: {
semi: ['error', 'always'],
'react/react-in-jsx-scope': 0,
'react/jsx-uses-react': 0,
},
},
{
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'script',
},
files: ['*.cjs'],
extends: ['eslint:recommended', 'plugin:prettier/recommended', 'plugin:node/recommended'],
rules: {
'node/no-unpublished-require': 'off',
'node/no-unsupported-features/es-syntax': [
'error',
{
version: '>=12.0.0',
},
],
semi: ['error', 'always'],
},
},
],
};