Skip to content

Commit 563526d

Browse files
committed
Add eslint
1 parent b03c4b2 commit 563526d

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

.eslintrc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"es6": true,
5+
"node": true
6+
},
7+
"parserOptions": {
8+
"ecmaVersion": 2020,
9+
"sourceType": "module"
10+
},
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:import/recommended"
14+
],
15+
"plugins": ["import"],
16+
"rules": {
17+
"array-bracket-spacing": "error",
18+
"arrow-parens": "error",
19+
"comma-dangle": "error",
20+
"dot-location": ["error", "property"],
21+
"eol-last": "error",
22+
"generator-star-spacing": ["error", { "before": false, "after": true }],
23+
"indent": ["error", 2, { "ignoreComments": true, "SwitchCase": 1 }],
24+
"linebreak-style": "error",
25+
"no-trailing-spaces": "error",
26+
"no-unused-vars": ["error", { "argsIgnorePattern": "_.*" }],
27+
"prefer-const": ["error", { "destructuring": "all" }],
28+
"semi": "error",
29+
"quotes": ["error", "double", { "allowTemplateLiterals": true }]
30+
},
31+
"settings": {
32+
"import/resolver": "node"
33+
}
34+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ relative-json-pointer.txt
1010

1111
package-lock.json
1212
node_modules/
13+
14+
.env

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"type": "module",
66
"main": "index.js",
77
"scripts": {
8+
"lint": "eslint build/",
89
"build": "npm run build-core && npm run build-validation",
910
"build-core": "node build/build.js < jsonschema-core.md > jsonschema-core.html",
1011
"build-validation": "node build/build.js < jsonschema-validation.md > jsonschema-validation.html"
@@ -27,6 +28,9 @@
2728
"vfile-reporter": "^8.0.0"
2829
},
2930
"devDependencies": {
30-
"dotenv": "^16.3.1"
31+
"dotenv": "*",
32+
"eslint": "*",
33+
"eslint-import-resolver-node": "*",
34+
"eslint-plugin-import": "*"
3135
}
3236
}

0 commit comments

Comments
 (0)