Skip to content

Commit

Permalink
Switch over to eslint from tslint (#370)
Browse files Browse the repository at this point in the history
* Adds eslint to replace tslint.
* Uses recommended typescript rules.
* Autofixable issues have been fixed, and other issues are ignored via comments.
* Eslint runs separately to gulp, since I think we are moving away from gulp long term, and this is a cleaner solution even if we don't.
* Husky added so that files are linted pre-commit.
* Update travis to lint pre build.
  • Loading branch information
Brookke authored Jan 6, 2021
1 parent 48961d2 commit 92a4415
Show file tree
Hide file tree
Showing 49 changed files with 2,573 additions and 970 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/dist/*
**/build/*
**/gulpfile.js

# Todo: remove and fix at some stage
examples/*
24 changes: 24 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-inferrable-types": ["error", { "ignoreProperties": true, "ignoreParameters": true}],
"no-console": "error"
},
"overrides": [
{
"files": ["**/*.spec.ts"],
"rules": {
"@typescript-eslint/no-empty-function": "off",
"no-console": "warn"
}
}
]

}
1 change: 0 additions & 1 deletion .gulp/gulpConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module.exports = {
threshold: 80
}
},
tslint: '../../tslint.json',
documentation: {
src: ['packages/**/src/**/*.ts', '!**/*.d.ts' , '!**/node_modules/**/*'],
out: 'docs/'
Expand Down
2 changes: 1 addition & 1 deletion .gulp/tasks/stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var sourcemaps = require('gulp-sourcemaps'),

module.exports = function (gulp, config) {
return function () {
var tsProject = gulpts.createProject('./tsconfig-staging.json');
var tsProject = gulpts.createProject('./tsconfig.staging.json');

var tsResult = tsProject.src()
.pipe(sourcemaps.init())
Expand Down
11 changes: 0 additions & 11 deletions .gulp/tasks/tslint.js

This file was deleted.

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ matrix:

script:
- npm run bootstrap
- npm run lint
- npm run build
- npm test
- npm run docs
Expand Down
10 changes: 3 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
{
"json.schemas": [
{
"fileMatch": [ "tslint.json" ],
"url": "http://json.schemastore.org/tslint"
},
{
"fileMatch": [ "app.json" ],
"url": "http://json.schemastore.org/openfin"
"url": "https://json.schemastore.org/openfin"
},
{
"fileMatch": [ "tsconfig-staging.json" ],
"url": "http://json.schemastore.org/tsconfig"
"fileMatch": [ "tsconfig.staging.json" ],
"url": "https://json.schemastore.org/tsconfig"
}
]
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"problemMatcher": [
"$tsc",
{
"owner": "tslint",
"owner": "eslint",
"pattern": {
"regexp": "^(.+):\\s+\\(.+\\)\\s(\\S+)\\[(\\d+)(.{2})(\\d+)\\]:\\s+(.+)$",
"severity": 0,
Expand Down
Loading

0 comments on commit 92a4415

Please sign in to comment.