Skip to content

Commit a104742

Browse files
committed
use single eslintrc-file for extensions/ and src/, no type check rules
1 parent d0e72fe commit a104742

6 files changed

Lines changed: 69 additions & 111 deletions

File tree

.eslintignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
**/vs/nls.build.js
2+
**/vs/nls.js
3+
**/vs/css.build.js
4+
**/vs/css.js
5+
**/vs/loader.js
6+
**/promise-polyfill/**
7+
**/insane/**
8+
**/marked/**
9+
**/test/**/*.js
10+
**/node_modules/**
11+
**/vscode-api-tests/testWorkspace/**
12+
**/extensions/**/out/**
13+
**/extensions/**/build/**

.eslintrc.json

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,54 @@
11
{
2-
"root": true,
3-
"env": {
4-
"node": true,
5-
"es6": true
6-
},
7-
"rules": {
8-
"no-console": 0,
9-
"no-cond-assign": 0,
10-
"no-unused-vars": 1,
11-
"no-extra-semi": "warn",
12-
"semi": "warn"
13-
},
14-
"extends": "eslint:recommended",
15-
"parserOptions": {
16-
"ecmaFeatures": {
17-
"experimentalObjectRestSpread": true
18-
}
19-
}
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"plugins": [
9+
"code-oss-eslint",
10+
"@typescript-eslint"
11+
],
12+
"rules": {
13+
"no-extra-semi": "off",
14+
"no-unused-vars": "off",
15+
"eqeqeq": "warn",
16+
"semi": "off",
17+
"@typescript-eslint/semi": "warn",
18+
"no-duplicate-imports": "warn",
19+
"code-oss-eslint/layering": [
20+
"warn",
21+
{
22+
"common": [],
23+
"node": [
24+
"common"
25+
],
26+
"browser": [
27+
"common"
28+
],
29+
"electron-main": [
30+
"common",
31+
"node"
32+
],
33+
"electron-browser": [
34+
"common",
35+
"browser",
36+
"node"
37+
]
38+
}
39+
],
40+
"@typescript-eslint/class-name-casing": "warn",
41+
"constructor-super": "warn",
42+
"curly": "warn",
43+
"no-caller": "warn",
44+
"no-debugger": "warn",
45+
"no-duplicate-case": "warn",
46+
"no-eval": "warn",
47+
"no-new-wrappers": "warn",
48+
"no-sparse-arrays": "warn",
49+
"no-throw-literal": "warn",
50+
"no-unsafe-finally": "warn",
51+
"no-unused-labels": "warn",
52+
"no-var": "warn"
53+
}
2054
}

build/gulpfile.hygiene.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ const copyrightHeaderLines = [
186186
gulp.task('eslint', () => {
187187
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
188188
.pipe(filter(eslintFilter))
189-
.pipe(gulpeslint('src/.eslintrc'))
189+
.pipe(gulpeslint('.eslintrc.json'))
190190
.pipe(gulpeslint.formatEach('compact'))
191191
.pipe(gulpeslint.failAfterError());
192192
});
@@ -227,7 +227,7 @@ function checkPackageJSON(actualPath) {
227227

228228
const checkPackageJSONTask = task.define('check-package-json', () => {
229229
return gulp.src('package.json')
230-
.pipe(es.through(function() {
230+
.pipe(es.through(function () {
231231
checkPackageJSON.call(this, 'remote/package.json');
232232
checkPackageJSON.call(this, 'remote/web/package.json');
233233
}));
@@ -359,7 +359,7 @@ function hygiene(some) {
359359

360360
const javascript = result
361361
.pipe(filter(eslintFilter))
362-
.pipe(gulpeslint('src/.eslintrc'))
362+
.pipe(gulpeslint('.eslintrc.json'))
363363
.pipe(gulpeslint.formatEach('compact'))
364364
.pipe(gulpeslint.failAfterError());
365365

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"strict-function-types-watch": "tsc --watch -p src/tsconfig.json --noEmit --strictFunctionTypes",
2929
"update-distro": "node build/npm/update-distro.js",
3030
"web": "node scripts/code-web.js",
31-
"eslint": "eslint -c ./src/.eslintrc.json ./src/vs --ext .ts --ext .js"
31+
"eslint": "eslint -c .eslintrc.json --ext .ts --ext .js ./src/vs ./extensions"
3232
},
3333
"dependencies": {
3434
"applicationinsights": "1.0.8",

src/.eslintrc

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/.eslintrc.json

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)