Skip to content

Commit 7ce2cb1

Browse files
committed
added default eslint and babel rc files
1 parent 9a6dc1d commit 7ce2cb1

2 files changed

Lines changed: 144 additions & 0 deletions

File tree

src/babelrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": {"browsers": [ "> 2%", "last 2 versions" ]},
7+
"modules": false
8+
}
9+
]
10+
]
11+
}

src/eslintrc.json

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"es2021": true
6+
},
7+
"extends": "eslint:recommended",
8+
"parser": "@babel/eslint-parser",
9+
"parserOptions": {
10+
"ecmaVersion": 2020,
11+
"sourceType": "module"
12+
},
13+
14+
"rules": {
15+
"strict": 2,
16+
17+
"for-direction": 2,
18+
"getter-return": 2,
19+
"no-compare-neg-zero": 2,
20+
"no-cond-assign": [ 2, "except-parens" ],
21+
"no-console": 1,
22+
"no-constant-condition": 2,
23+
"no-control-regex": 2,
24+
"no-debugger": 2,
25+
"no-dupe-args": 2,
26+
"no-dupe-keys": 2,
27+
"no-duplicate-case": 2,
28+
"no-empty-character-class": 2,
29+
"no-empty": 2,
30+
"no-ex-assign": 2,
31+
"no-extra-boolean-cast": 2,
32+
"no-extra-parens": [ 1, "all" ],
33+
"no-extra-semi": 2,
34+
"no-func-assign": 2,
35+
"no-inner-declarations": [ 2, "functions" ],
36+
"no-invalid-regexp": 2,
37+
"no-irregular-whitespace": 2,
38+
"no-obj-calls": 2,
39+
"no-prototype-builtins": 2,
40+
"no-regex-spaces": 2,
41+
"no-sparse-arrays": 2,
42+
"no-unexpected-multiline": 2,
43+
"no-unreachable": 2,
44+
"no-unsafe-finally": 1,
45+
"no-unsafe-negation": 2,
46+
"use-isnan": 2,
47+
"valid-jsdoc": 2,
48+
"valid-typeof": 2,
49+
50+
"no-delete-var": 2,
51+
"no-label-var": 2,
52+
"no-shadow": 2,
53+
"no-shadow-restricted-names": 2,
54+
"no-undef": [ 2, { "typeof": true } ],
55+
"no-undef-init": 2,
56+
"no-undefined": 2,
57+
"no-unused-vars": 2,
58+
"no-use-before-define": 2,
59+
60+
"arrow-body-style": [ 2, "always" ],
61+
"arrow-parens": [ 2, "always" ],
62+
"arrow-spacing": [ 2, { "before": true, "after": true } ],
63+
"constructor-super": 2,
64+
"generator-star-spacing": [ 2,{"before":true,"after":true} ],
65+
"no-class-assign": 2,
66+
"no-confusing-arrow": [ 2, {"allowParens": false} ],
67+
"no-const-assign": 2,
68+
"no-dupe-class-members": 2,
69+
"no-duplicate-imports": [ 2, { "includeExports": true } ],
70+
"no-new-symbol": 2,
71+
"no-this-before-super": 2,
72+
"no-useless-computed-key": 2,
73+
"no-useless-constructor": 2,
74+
"no-useless-rename": 2,
75+
"no-var": 1,
76+
"object-shorthand": [ 2, "consistent-as-needed" ],
77+
"prefer-arrow-callback": [ 2, { "allowNamedFunctions": true, "allowUnboundThis": true } ],
78+
"prefer-const": [ 1, { "destructuring": "any", "ignoreReadBeforeAssign": false } ],
79+
"prefer-numeric-literals": 2,
80+
"prefer-rest-params": 1,
81+
"prefer-spread": 1,
82+
"prefer-template": 0,
83+
"require-yield": 2,
84+
"rest-spread-spacing": [ 2, "never" ],
85+
"symbol-description": 1,
86+
"template-curly-spacing": [ 2, "never" ],
87+
"yield-star-spacing": [ "error", { "before": true, "after": true } ],
88+
89+
"array-bracket-newline": [ 2, { "multiline": true, "minItems": 3 } ],
90+
"array-bracket-spacing": [ 2, "always"],
91+
"array-element-newline": [ 2, { "multiline": true, "minItems": 3 } ],
92+
"block-spacing" : 2,
93+
"brace-style": [ 2, "1tbs", { "allowSingleLine": true } ],
94+
"comma-dangle": [ 2, { "arrays": "only-multiline", "objects": "only-multiline", "imports": "never", "exports": "never", "functions": "ignore" } ],
95+
"comma-spacing": [2, { "before": false, "after": true } ],
96+
"computed-property-spacing": [ 2, "always" ],
97+
"consistent-this": [ 1, "_self" ],
98+
"eol-last": [ 2, "always" ],
99+
"func-call-spacing": [ 2, "never" ],
100+
"indent": [ 2, 4 ],
101+
"key-spacing": [ 2, { "beforeColon": true, "afterColon": true, "mode": "strict" } ],
102+
"keyword-spacing": [ 2, { "before": true, "after": true } ],
103+
"linebreak-style": [ 2, "unix" ],
104+
"lines-around-comment": [ 2, { "beforeBlockComment": true, "beforeLineComment": true } ],
105+
"lines-between-class-members": [ 2, "always" ],
106+
"max-len": [ 1, { "code": 140, "ignoreComments": true, "ignoreTrailingComments": true, "ignoreUrls": true, "ignoreStrings": false, "ignoreTemplateLiterals": true, "ignoreRegExpLiterals": true } ],
107+
"new-cap": [ 2, { "newIsCap": true, "capIsNew": false } ],
108+
"new-parens": 2,
109+
"no-lonely-if": 2,
110+
"no-mixed-spaces-and-tabs": 2,
111+
"no-multiple-empty-lines": [ 1, { "max": 1, "maxEOF": 1 } ],
112+
"no-trailing-spaces": 2,
113+
"no-unneeded-ternary": 2,
114+
115+
"object-curly-newline": [ 2, { "ObjectExpression": { "multiline": true, "minProperties": 8 }, "ObjectPattern": { "multiline": true, "minProperties": 8 }, "ImportDeclaration": { "multiline": true, "minProperties": 8 }, "ExportDeclaration": { "multiline": true, "minProperties": 8 } } ],
116+
"object-curly-spacing": [ 2, "always", { "arraysInObjects": true, "objectsInObjects": true } ],
117+
"one-var": [ 2, { "var": "always", "let": "consecutive", "const": "never" } ],
118+
119+
"quotes": [ 2, "single", { "avoidEscape": true } ],
120+
"require-jsdoc": [ 1, { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true, "FunctionExpression": true } } ],
121+
"semi": 2,
122+
"semi-spacing": 2,
123+
"semi-style": [ 2, "last" ],
124+
"space-before-blocks": [ 2, "always" ],
125+
"space-before-function-paren": [ 2, "never" ],
126+
"space-in-parens": [ 2, "always" ],
127+
"space-infix-ops": [ 2, { "int32Hint": false } ],
128+
"space-unary-ops": [ 2, { "words": true, "nonwords": false } ],
129+
"spaced-comment": [ 2, "always" ],
130+
"switch-colon-spacing": [ 2, { "after": true, "before": true } ],
131+
"template-tag-spacing": [ 2, "always" ]
132+
}
133+
}

0 commit comments

Comments
 (0)