-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
56 lines (54 loc) · 1.44 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
// TODO: add @typescript-eslint
// prettier-ignore
const RULE_DOC_TMPL = require("./lib/consts").ruleDocUrl;
module.exports = {
parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: {
jsx: true,
modules: true,
},
sourceType: "module",
},
env: {
browser: true,
es6: true,
amd: true,
node: true,
mocha: true,
},
plugins: ["eslint-plugin"],
extends: [
"eslint:recommended",
"plugin:prettier/recommended",
"prettier",
"plugin:eslint-plugin/all",
],
rules: {
// variables
"prefer-const": 2,
"no-var": 2,
// base
"camelcase": [1, { ignoreDestructuring: true, ignoreImports: true, properties: "never" }],
"no-else-return": 2,
"max-len": [1, { code: 120 }],
"dot-notation": 2,
"eol-last": 2,
// alert, console
"no-alert": 2,
"no-console": 0,
// equals
"eqeqeq": 1,
"no-eq-null": 2,
// function
"max-params": [1, 2],
"max-lines-per-function": [1, 100],
"arrow-parens": [2, "always"],
"prefer-arrow-callback": 2,
// TODO: add other plugins (unicorn, ...)
// plugin: eslint-plugin
"eslint-plugin/prefer-output-null": 0,
// FIXME: more strict
"eslint-plugin/require-meta-docs-url": [2, { pattern: RULE_DOC_TMPL }],
},
};