-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
140 lines (129 loc) · 3.72 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/** @type { import('eslint').Linter.Config } */
const options = {
root: true,
/** @package @babel/eslint-parser */
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
/* environment defines global variables that are predefined */
env: {
browser: true,
es6: true,
commonjs: true,
node: true,
},
/* variables */
globals: {
Atomics: false,
SharedArrayBuffer: false,
App: true,
},
/* third-party plugins */
plugins: ['proposal'],
/* Plugins may provide processors */
processor: '',
overrides: [
{
files: ['**/*.md'],
rules: {
'no-undef': ['off'],
'no-unused-vars': ['off'],
'no-console': ['off'],
},
},
],
/* Adding Shared Settings */
settings: {},
/* Extending Configuration */
extends: [
/**
* enables a subset of core rules that report common problems
* @see {@link https://eslint.org/docs/user-guide/configuring#using-eslintrecommended}
*/
'eslint:recommended',
/**
* @integration prettier
* @package eslint-config-prettier
* @description eslint-config-prettier is a config that disables rules that conflict with Prettie.
* @package eslint-plugin-prettier
* @description eslint-plugin-prettier is a plugin that adds a rule that formats content using Prettier.
* @recommended eslint-plugin-prettier exposes a "recommended" configuration that configures both eslint-plugin-prettier and eslint-config-prettier in a single step.
*/
'plugin:prettier/recommended',
],
rules: {
/**
* Possible Errors
*/
// Disallow the use of console
// "no-console": ["warn", { "allow": ["warn", "error", "log", "info"] }],
// "debugger": "warn",
// calling `Object.prototype` method directly on objects
'no-prototype-builtins': ['off'],
// Disallow template literal placeholder syntax in regular strings
'no-template-curly-in-string': ['warn'],
/**
* Best Practices
*/
// Require default cases in switch statements
'default-case': ['warn'],
// Enforce dot notation whenever possible
'dot-notation': ['warn'],
// Require the use of === and !==
eqeqeq: ['warn', 'always', { null: 'ignore' }],
// Disallow the use of alert, confirm, and prompt
'no-alert': ['warn'],
// Disallow the use of arguments.caller or arguments.callee
'no-caller': ['warn'],
// require or disallow strict mode directives
// "strict"
/**
* Variables
*/
// Disallow initializing variables to undefined
'no-undef-init': ['warn'],
// Disallow unused variables
'no-unused-vars': [
'warn',
{
args: 'none',
caughtErrors: 'none',
},
],
/**
* CommonJS
*/
// Disallow string concatenation with __dirname and __filename
'no-path-concat': ['warn'],
/**
* Stylistic
*/
// Enforce consistent spacing after the // or \/* in a comment
'spaced-comment': ['warn'],
/**
* ES6
*/
// Require braces in arrow function body = as-needed
'arrow-body-style': ['warn'],
// Disallow duplicate imports = { includeExports: false }
'no-duplicate-imports': ['warn'],
// Disallow unnecessary computed property keys on objects
'no-useless-computed-key': ['warn'],
// Require Objarrow-spacingect Literal Shorthand Syntax
'object-shorthand': ['warn', 'properties'],
// Suggest using const
'prefer-const': [
'warn',
{
destructuring: 'all',
},
],
// Require template literals instead of string concatenation
'prefer-template': ['warn'],
'prettier/prettier': ['warn'],
},
};
module.exports = options;