Skip to content

Commit 75060b4

Browse files
committed
Add Eslint
Add json lint
1 parent 0afc596 commit 75060b4

File tree

2 files changed

+91
-2
lines changed

2 files changed

+91
-2
lines changed

.eslintrc.json

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
// JS Files
3+
"root": true,
4+
"env": {
5+
"atomtest": true,
6+
"es6": true,
7+
"node": true,
8+
"browser": true,
9+
"jasmine": true
10+
},
11+
"globals": { "atom": "writable" },
12+
"parser": "babel-eslint",
13+
"parserOptions": {
14+
"ecmaFeatures": { "jsx": true },
15+
"ecmaVersion": 2018,
16+
"sourceType": "module"
17+
},
18+
"plugins": ["only-warn"],
19+
"extends": ["eslint:recommended"],
20+
"overrides": [
21+
{ // Bundled node version with atom has an old ESLint
22+
// TypeScript files
23+
"files": ["**/*.ts", "**/*.tsx"],
24+
"env": {
25+
"atomtest": true,
26+
"es6": true,
27+
"node": true,
28+
"browser": true
29+
},
30+
"globals": { "atom": "writable" },
31+
"parser": "@typescript-eslint/parser",
32+
"parserOptions": {
33+
"ecmaFeatures": { "jsx": true },
34+
"ecmaVersion": 2018,
35+
"sourceType": "module"
36+
},
37+
"plugins": ["@typescript-eslint", "only-warn"],
38+
"extends": [
39+
"eslint:recommended",
40+
"plugin:@typescript-eslint/eslint-recommended",
41+
"plugin:@typescript-eslint/recommended"
42+
],
43+
"rules": {
44+
"@typescript-eslint/explicit-function-return-type": "off",
45+
"@typescript-eslint/camelcase": "off",
46+
"@typescript-eslint/no-use-before-define": "off",
47+
"@typescript-eslint/member-delimiter-style": "off"
48+
}
49+
},
50+
{
51+
// CoffeeScript files
52+
"files": ["**/*.coffee"],
53+
"env": {
54+
"atomtest": true,
55+
"es6": true,
56+
"node": true,
57+
"browser": true
58+
},
59+
"globals": { "atom": "writable" },
60+
// "parser": "eslint-plugin-coffee",
61+
"parser": "eslint-plugin-coffee",
62+
"parserOptions": {
63+
"ecmaFeatures": { "jsx": true },
64+
"ecmaVersion": 2018,
65+
"sourceType": "module"
66+
},
67+
"plugins": ["coffee", "only-warn"],
68+
"extends": ["plugin:coffee/eslint-recommended"]
69+
},
70+
{
71+
// JSON files
72+
"files": ["*.json"],
73+
"plugins": ["json"],
74+
"extends": ["plugin:json/recommended"],
75+
"rules": {
76+
"json/*": ["error", {"allowComments": true}]
77+
}
78+
}
79+
]
80+
}

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,26 @@
3838
},
3939
"devDependencies": {
4040
"@types/atom": "^1.40.1",
41-
"@types/ssh2": "^0.5.41",
4241
"@types/fuzzaldrin-plus": "^0.6.0",
4342
"@types/object-hash": "^1.3.1",
4443
"@types/semver": "^7.1.0",
44+
"@types/ssh2": "^0.5.41",
4545
"@types/underscore": "^1.9.4",
46+
"eslint": "latest",
47+
"@typescript-eslint/eslint-plugin": "latest",
48+
"@typescript-eslint/parser": "latest",
49+
"babel-eslint": "latest",
50+
"coffeescript": "latest",
51+
"eslint-plugin-coffee": "latest",
52+
"eslint-plugin-json": "latest",
53+
"eslint-plugin-only-warn": "latest",
4654
"prettier": "latest",
4755
"tslint": "latest",
4856
"tslint-config-prettier": "latest"
4957
},
5058
"scripts": {
51-
"postinstall": "node script/postinstall.js"
59+
"postinstall": "node script/postinstall.js",
60+
"lint": "eslint . --ext js,ts,coffee"
5261
},
5362
"consumedServices": {
5463
"status-bar": {

0 commit comments

Comments
 (0)