Move from tslint to eslint

This commit is contained in:
Manuel Thalmann 2021-05-10 23:13:23 +00:00
parent 1337771f59
commit 1e6daaacd7
11 changed files with 2073 additions and 70 deletions

View file

@ -6,6 +6,7 @@
"extensions": [ "extensions": [
"adrianhumphreys.silverstripe", "adrianhumphreys.silverstripe",
"felixfbecker.php-pack", "felixfbecker.php-pack",
"manuth.eslint-language-service",
"ms-vscode.vscode-typescript-tslint-plugin", "ms-vscode.vscode-typescript-tslint-plugin",
"neilbrayfield.php-docblocker" "neilbrayfield.php-docblocker"
], ],

21
.eslintrc.js Normal file
View file

@ -0,0 +1,21 @@
const { join } = require("path");
let appRoot = join(__dirname, "src", "App");
module.exports = {
extends: [
"plugin:@manuth/typescript/recommended-requiring-type-checking"
],
env: {
node: true,
es6: true
},
parserOptions: {
project: [
join(__dirname, "tsconfig.json"),
join(__dirname, "tsconfig.eslint.json"),
join(appRoot, "tsconfig.json"),
join(appRoot, "src", "tests", "tsconfig.json")
]
}
};

View file

@ -5,9 +5,8 @@
// List of extensions which should be recommended for users of this workspace. // List of extensions which should be recommended for users of this workspace.
"recommendations": [ "recommendations": [
"adrianhumphreys.silverstripe", "adrianhumphreys.silverstripe",
"dbaeumer.vscode-eslint",
"felixfbecker.php-pack", "felixfbecker.php-pack",
"ms-vscode.vscode-typescript-tslint-plugin", "manuth.eslint-language-service",
"ms-vscode-remote.remote-containers", "ms-vscode-remote.remote-containers",
"msjsdiag.debugger-for-chrome", "msjsdiag.debugger-for-chrome",
"neilbrayfield.php-docblocker" "neilbrayfield.php-docblocker"

2022
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -11,14 +11,17 @@
"stop-release": "gulp Stop -t Release", "stop-release": "gulp Stop -t Release",
"clean": "gulp Clean", "clean": "gulp Clean",
"lint": "npm run lint-gulp && npm run lint-project", "lint": "npm run lint-gulp && npm run lint-project",
"lint-gulp": "tslint -p . -t verbose", "lint-base": "eslint --max-warnings 0 --ignore-pattern \"!.eslintrc.js\"",
"lint-project": "tslint -p ./src/App -t verbose", "lint-gulp": "npm run lint-base -- --ext .ts ./.gulp gulpfile.ts",
"lint-project": "npm run lint-base -- --ext .js,.jsx,.ts,.tsx ./src/App/src",
"lint-ide": "npm run lint || exit 0",
"prepare": "npm run rebuild" "prepare": "npm run rebuild"
}, },
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"@manuth/eslint-plugin-typescript": "^2.3.9",
"@manuth/tsconfig": "^1.2.9", "@manuth/tsconfig": "^1.2.9",
"@manuth/tslint-presets": "^1.0.5", "@manuth/typescript-eslint-plugin": "^1.3.5",
"@types/bootstrap": "^5.0.13", "@types/bootstrap": "^5.0.13",
"@types/browser-sync": "^2.26.1", "@types/browser-sync": "^2.26.1",
"@types/browserify": "^12.0.36", "@types/browserify": "^12.0.36",
@ -32,15 +35,22 @@
"@types/jquery": "^3.5.5", "@types/jquery": "^3.5.5",
"@types/merge-stream": "^1.1.2", "@types/merge-stream": "^1.1.2",
"@types/minimist": "^1.2.1", "@types/minimist": "^1.2.1",
"@types/node": "^15.0.2", "@types/node": "^15.0.1",
"@types/promise-queue": "^2.2.0", "@types/promise-queue": "^2.2.0",
"@types/vinyl-buffer": "^1.0.0", "@types/vinyl-buffer": "^1.0.0",
"@types/vinyl-source-stream": "0.0.30", "@types/vinyl-source-stream": "0.0.30",
"@types/watchify": "^3.11.0", "@types/watchify": "^3.11.0",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/eslint-plugin-tslint": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"bootstrap": "^5.0.0", "bootstrap": "^5.0.0",
"browser-sync": "^2.26.14", "browser-sync": "^2.26.14",
"browserify": "^17.0.0", "browserify": "^17.0.0",
"create-symlink": "^1.0.0", "create-symlink": "^1.0.0",
"eslint": "^7.25.0",
"eslint-plugin-deprecation": "^1.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^32.3.3",
"fancy-log": "^1.3.3", "fancy-log": "^1.3.3",
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
"gulp": "^4.0.2", "gulp": "^4.0.2",
@ -57,7 +67,7 @@
"string-argv": "^0.3.1", "string-argv": "^0.3.1",
"ts-node": "^9.1.1", "ts-node": "^9.1.1",
"tsify": "^5.0.3", "tsify": "^5.0.3",
"tslint": "^5.20.1", "tslint": "^6.1.3",
"typescript": "^4.2.4", "typescript": "^4.2.4",
"typescript-tslint-plugin": "^1.0.1", "typescript-tslint-plugin": "^1.0.1",
"upath": "^2.0.1", "upath": "^2.0.1",

View file

@ -1,20 +1,17 @@
{ {
"extends": "@manuth/tsconfig/recommended", "extends": "../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"rootDir": "src",
"lib": [
"ES2020",
"DOM"
]
},
"files": [ "files": [
"src/main.ts" "src/main.ts"
], ],
"compilerOptions": { "exclude": [
"rootDir": "src", "./src/tests/**/*"
"module": "commonjs", ]
"lib": [
"es7",
"dom"
],
"plugins": [
{
"name": "typescript-tslint-plugin"
}
],
"target": "es5"
}
} }

View file

@ -1,3 +0,0 @@
{
"extends": "@manuth/tslint-presets/recommended"
}

16
tsconfig.base.json Normal file
View file

@ -0,0 +1,16 @@
{
"extends": "@manuth/tsconfig/recommended",
"compilerOptions": {
"declaration": true,
"module": "CommonJS",
"lib": [
"ES2020"
],
"plugins": [
{
"name": "@manuth/typescript-eslint-plugin"
}
],
"target": "ES6"
}
}

9
tsconfig.eslint.json Normal file
View file

@ -0,0 +1,9 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"noEmit": true
},
"include": [
"./.eslintrc.js"
]
}

View file

@ -1,16 +1,7 @@
{ {
"extends": "@manuth/tsconfig/recommended", "extends": "./tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "noEmit": true
"lib": [
"es7"
],
"plugins": [
{
"name": "typescript-tslint-plugin"
}
],
"target": "es5"
}, },
"files": [ "files": [
"./gulpfile.ts" "./gulpfile.ts"

View file

@ -1,6 +0,0 @@
{
"extends": "@manuth/tslint-presets/recommended",
"rules": {
"interface-name": false
}
}