Skip to content

Commit 1955250

Browse files
authored
build: replace tslint with eslint (typestack#591)
1 parent 1724bde commit 1955250

File tree

127 files changed

+1240
-518
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+1240
-518
lines changed

.eslintrc.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true
5+
},
6+
parser: "@typescript-eslint/parser",
7+
parserOptions: {
8+
project: ['./tsconfig.json']
9+
},
10+
plugins: [
11+
"@typescript-eslint"
12+
],
13+
extends: [
14+
"eslint:recommended",
15+
"plugin:@typescript-eslint/eslint-recommended",
16+
"plugin:@typescript-eslint/recommended",
17+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
18+
],
19+
ignorePatterns: ["**/*.js"],
20+
rules: {
21+
"no-prototype-builtins": "off",
22+
"@typescript-eslint/no-inferrable-types": "off",
23+
"@typescript-eslint/no-non-null-assertion": "off",
24+
"@typescript-eslint/no-unused-vars": "off",
25+
"@typescript-eslint/no-explicit-any": "off",
26+
"@typescript-eslint/member-ordering": "error",
27+
"@typescript-eslint/unbound-method": ["error", {
28+
"ignoreStatic": true
29+
}],
30+
"@typescript-eslint/prefer-includes": "off"
31+
}
32+
};

gulpfile.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import * as gulp from "gulp";
44
import * as del from "del";
55
import * as shell from "gulp-shell";
66
import * as replace from "gulp-replace";
7-
import tslintPlugin from "gulp-tslint";
87
import * as ts from "gulp-typescript";
98
import * as sourcemaps from "gulp-sourcemaps";
109
import { rollup, RollupOptions, Plugin } from "rollup";
1110
import { terser as rollupTerser } from "rollup-plugin-terser";
11+
import * as childProcess from "child_process";
1212

1313
const pkg = require("./package.json");
1414

@@ -68,7 +68,7 @@ export class Gulpfile {
6868
*/
6969
@Task()
7070
runTests() {
71-
return require("child_process").spawn("npx jest --coverage", {
71+
return childProcess.spawn("npx jest --coverage", {
7272
stdio: 'inherit',
7373
shell: true
7474
});
@@ -222,23 +222,22 @@ export class Gulpfile {
222222
// -------------------------------------------------------------------------
223223

224224
/**
225-
* Runs ts linting to validate source code.
225+
* Runs es linting to validate source code.
226226
*/
227227
@Task()
228-
tslint() {
229-
return gulp.src(["./src/**/*.ts", "./test/**/*.ts", "./sample/**/*.ts"])
230-
.pipe(tslintPlugin())
231-
.pipe(tslintPlugin.report({
232-
emitError: true
233-
}));
228+
eslint() {
229+
return childProcess.spawn("npx eslint --config ./.eslintrc.js --ext .ts ./src ./test", {
230+
stdio: 'inherit',
231+
shell: true
232+
});
234233
}
235234

236235
/**
237236
* Compiles the code and runs tests.
238237
*/
239238
@SequenceTask()
240239
tests() {
241-
return ["clean", "tslint", "runTests"];
240+
return ["clean", "eslint", "runTests"];
242241
}
243242

244243
private _rollupPackageBundleEsm5(isMin: boolean) {

0 commit comments

Comments
 (0)