Skip to content

Commit 43b34b6

Browse files
committed
Add Eslint
Add json lint Update package.json
1 parent 7db483e commit 43b34b6

File tree

2 files changed

+95
-5
lines changed

2 files changed

+95
-5
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: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,40 @@
2525
"atom": ">=1.39.0 <2.0.0"
2626
},
2727
"dependencies": {
28-
"atom-package-deps": "*",
28+
"atom-package-deps": "latest",
2929
"atom-space-pen-views": "^2.0.0",
3030
"etch": "^0.14",
3131
"fuzzaldrin-plus": "^0.6.0",
3232
"node-pty-prebuilt-multiarch": "0.9.0",
3333
"object-hash": "^2.0.3",
34-
"physical-cpu-count": "*",
34+
"physical-cpu-count": "latest",
3535
"semver": "^6.3.0",
3636
"ssh2": "^0.8.4",
37-
"underscore-plus": "*"
37+
"underscore-plus": "latest"
3838
},
3939
"devDependencies": {
40+
"typescript": "^3.8.3",
41+
"coffeescript": "^2.5.1",
4042
"@types/atom": "^1.40.1",
41-
"@types/ssh2": "^0.5.41",
4243
"@types/fuzzaldrin-plus": "^0.6.0",
4344
"@types/object-hash": "^1.3.1",
4445
"@types/semver": "^7.1.0",
46+
"@types/ssh2": "^0.5.41",
4547
"@types/underscore": "^1.9.4",
48+
"eslint": "latest",
49+
"@typescript-eslint/eslint-plugin": "latest",
50+
"@typescript-eslint/parser": "latest",
51+
"babel-eslint": "latest",
52+
"eslint-plugin-coffee": "latest",
53+
"eslint-plugin-json": "latest",
54+
"eslint-plugin-only-warn": "latest",
4655
"prettier": "latest",
4756
"tslint": "latest",
4857
"tslint-config-prettier": "latest"
4958
},
5059
"scripts": {
51-
"postinstall": "node script/postinstall.js"
60+
"postinstall": "node script/postinstall.js",
61+
"lint": "eslint . --ext js,ts,coffee"
5262
},
5363
"consumedServices": {
5464
"status-bar": {

0 commit comments

Comments
 (0)