forked from theRAPTLab/meme
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
95 lines (91 loc) · 2.79 KB
/
.eslintrc.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
88
89
90
91
92
93
94
95
/*///////////////////////////////// ABOUT \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*\
eslint configuration for MEME
updated 2024-06-18
\*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ * /////////////////////////////////////*/
/// CONFIG BLOCKS /////////////////////////////////////////////////////////////
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/** base eslint configuration */
const CONFIG = {
'env': {
'browser': true,
'commonjs': true,
'es6': true,
'node': true
},
'plugins': ['import', 'prettier', 'react'],
'extends': ['airbnb', 'prettier'],
'globals': {
'PACKAGE_TITLE': 'readonly', // injected by webpack
'PACKAGE_VERSION': 'readonly', // injected by webpack
'PACKAGE_DESCRIPTION': 'readonly', // injected by webpack
'__static': 'readonly' // injected by webpack
},
'parserOptions': {
'ecmaVersion': 2020,
'ecmaFeatures': {
'jsx': true
},
'sourceType': 'module'
}
};
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/** relaxations of rules that we don't mind */
const INQ_RULES = {
'prettier/prettier': ['warn'],
'no-console': 'off',
'no-debugger': 'warn',
'no-alert': 'warn',
'spaced-comment': 'off',
'react/jsx-filename-extension': [
1,
{
'extensions': ['.js', '.jsx']
}
],
'no-unused-vars': 'off',
'arrow-body-style': 'off',
'camelcase': 'off',
'no-use-before-define': 'off',
'import/no-extraneous-dependencies': [
'error',
{
'devDependencies': true
}
],
'no-underscore-dangle': 'off',
'no-plusplus': 'off',
'prefer-const': 'off',
'one-var': 'off',
'prefer-destructuring': 'off',
'class-methods-use-this': 'off',
'import/prefer-default-export': 'off',
// habit rules warnings
'no-param-reassign': 'warn',
'no-shadow': 'warn',
'grouped-accessor-pairs': 'warn',
'import/no-duplicates': ['warn', { 'considerQueryString': true }],
'radix': 'as-needed'
};
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/** react rules that we don't like */
const REACT_ICKS = {
'react/no-unescaped-entities': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-one-expression-per-line': 'off',
// new with removal of prettier/react, which is now included in prettier
'react/no-unused-class-component-methods': 'off',
'react/no-unused-prop-types': 'warn',
'react/no-unused-state': 'warn',
'react/prop-types': 'warn',
'react/jsx-props-no-spreading': 'warn',
'react/no-array-index-key': 'warn'
};
/// EXPORTS ///////////////////////////////////////////////////////////////////
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
module.exports = {
...CONFIG, // base eslint config
rules: {
...INQ_RULES, // default inq styles
...REACT_ICKS
}
};