Skip to content

Commit f91221c

Browse files
authored
Merge pull request #32 from M-DEV-1/M-DEV-1/setup-eslint
Setup: ESLint Config
2 parents 571fcd8 + cce6fb1 commit f91221c

File tree

6 files changed

+459
-86
lines changed

6 files changed

+459
-86
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ site-fast:
3535
clean:
3636
cd site; npx gatsby clean && npm start; cd ..
3737

38+
lint:
39+
cd site; npx eslint .; cd ..
40+
3841
#-----------------------------------------------------------------------------
3942
# Docker-based Builds
4043
#-----------------------------------------------------------------------------

site/.babelrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
[
4+
"babel-preset-gatsby",
5+
{
6+
"targets": {
7+
"browsers": [">0.25%", "not dead"]
8+
}
9+
}
10+
]
11+
]
12+
}

site/.eslintignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
node_modules/
2+
**/*.test.js
3+
src/utils/
4+
.cache/
5+
.github/
6+
assets/
7+
public/
8+
.babelrc
9+
.env.development
10+
CNAME
11+
CODE_OF_CONDUCT.md
12+
CODEOWNERS
13+
font-preload-cache.json
14+
LICENSE
15+
Makefile
16+
README.md
17+
package.json
18+
package-lock.json

site/.eslintrc.js

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
module.exports = {
2+
3+
"env": {
4+
"browser": true,
5+
"es6": true,
6+
"node": true,
7+
"amd": true
8+
},
9+
"settings": {
10+
"react": {
11+
"version": "detect"
12+
}
13+
},
14+
"extends": [
15+
"eslint:recommended",
16+
"plugin:react/recommended"
17+
],
18+
"parser": "@babel/eslint-parser",
19+
"parserOptions": {
20+
"ecmaFeatures": {
21+
"jsx": true
22+
},
23+
"ecmaVersion": 2018,
24+
"sourceType": "module"
25+
},
26+
"plugins": [
27+
"react"
28+
],
29+
"rules": {
30+
"array-bracket-spacing": ["error", "never"],
31+
"comma-style": ["error"],
32+
"arrow-spacing": [
33+
"error",
34+
{
35+
"after": true,
36+
"before": true
37+
}
38+
],
39+
"block-scoped-var": "error",
40+
"block-spacing": "error",
41+
"brace-style": [
42+
"error",
43+
"1tbs"
44+
],
45+
"jsx-quotes": ["error", "prefer-double"],
46+
"keyword-spacing": "error",
47+
"key-spacing": ["error", {
48+
"beforeColon": false,
49+
"afterColon": true,
50+
}],
51+
"no-unused-vars": [
52+
"warn",
53+
{
54+
"varsIgnorePattern": "React"
55+
}
56+
],
57+
"no-trailing-spaces": "error",
58+
"object-curly-spacing": ["error", "always"],
59+
"react/display-name": 0,
60+
"react/prop-types": 0,
61+
"react/no-unescaped-entities": [0],
62+
"react/jsx-no-duplicate-props": [0],
63+
"indent": [
64+
"error", 2, {
65+
"FunctionExpression": { "parameters": "first" },
66+
"FunctionDeclaration": { "parameters": "first" },
67+
"MemberExpression": 1,
68+
"SwitchCase": 1,
69+
"outerIIFEBody": 0,
70+
"VariableDeclarator": { "var": 2, "let": 2, "const": 3 },
71+
ignoredNodes: ["TemplateLiteral"]
72+
}
73+
],
74+
"linebreak-style": [
75+
"error",
76+
"unix"
77+
],
78+
"quotes": [
79+
"error",
80+
"double"
81+
],
82+
"semi": [
83+
"error",
84+
"always"
85+
],
86+
"strict": 0,
87+
"valid-typeof": 0,
88+
"space-unary-ops": [
89+
1, {
90+
"words": true,
91+
"nonwords": false
92+
}
93+
],
94+
"space-infix-ops": [
95+
"error"
96+
]
97+
}
98+
};

0 commit comments

Comments
 (0)