Skip to content

Commit

Permalink
[#174416949] Replace tslint with eslint (#752)
Browse files Browse the repository at this point in the history
* [#174416949] Replace italia-tslint-rules (tslint) with @pagopa/eslint-config

[#174416949] Restore app.ts layout

* [#174416949] Apply eslint to app.ts after rebase

* [#174416949] Refactor casting with unknown instead any

* [#174416949] Fix MessageSubject import path

* [#174416949] Revert .test.ts changes

* [#174416949] Add NL EOF

* [#174416949] Remove useless tslint:disable comment

* [#174416949] Remove useless eslint-disable-next-line

* [#174416949] Add eslint cache into lint script

* [#174416949] Fix after rebase

* [#174416949] Fix lint error (bug)

* [#174416949] Fix false positive no-shadow on enum

* [#174416949] Upgrade @pagopa/eslint-config
  • Loading branch information
BurnedMarshal authored Jan 22, 2021
1 parent 6367908 commit 925e59f
Show file tree
Hide file tree
Showing 67 changed files with 1,472 additions and 597 deletions.
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Never lint node_modules
node_modules

# We shouldn't lint assets nor generated files
generated

**/__tests__/*
**/__mocks__/*
Dangerfile.*
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"ignorePatterns": [
"node_modules",
"generated",
"**/__tests__/*",
"**/__mocks__/*",
"Dangerfile.*",
"*.d.ts"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"extends": [
"@pagopa/eslint-config/strong",
],
"rules": {
"prefer-arrow/prefer-arrow-functions": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"no-invalid-this": "off"
}
};
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ npm-debug.log

# Exclude typescript generated javascript files.
*.js
!.eslintrc.js
!.release-it.js
*.js.map

Expand All @@ -44,3 +45,6 @@ local.*

# Exclude Codetour plugin folder
.tours

# Exclude ESLint cache file
.eslintcache
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"build": "tsc",
"build-noemit": "tsc --noEmit",
"hot-reload": "nodemon --legacy-watch --watch ./src --inspect=0.0.0.0:5859 --nolazy src/server.js",
"lint": "tslint -p . -c tslint.json -t verbose",
"lint-autofix": "tslint -p . -c tslint.json -t verbose --fix",
"lint": "eslint . -c .eslintrc.js --ext .ts,.tsx --cache",
"lint-autofix": "eslint . -c .eslintrc.js --ext .ts,.tsx --fix",
"prettify": "prettier --write \"./**/*.ts\"",
"test": "jest -i",
"test:coverage": "dotenv -e .env.example -- jest -i --coverage",
Expand Down Expand Up @@ -89,6 +89,7 @@
"xmldom": "^0.1.27"
},
"devDependencies": {
"@pagopa/eslint-config": "^1.1.1",
"@types/apicache": "^1.2.0",
"@types/dotenv": "^4.0.2",
"@types/express": "4.16.0",
Expand Down Expand Up @@ -119,7 +120,7 @@
"danger": "^4.0.2",
"danger-plugin-digitalcitizenship": "^0.3.1",
"dotenv-cli": "^3.1.0",
"italia-tslint-rules": "^1.1.3",
"eslint-plugin-prettier": "^3.3.1",
"italia-utils": "^6.3.0",
"jest": "^23.6.0",
"lolex": "4.2.0",
Expand All @@ -136,7 +137,6 @@
"swagger-parser": "^5.0.5",
"ts-jest": "^23.10.4",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "^3.6.2"
},
"jest": {
Expand Down
1 change: 0 additions & 1 deletion src/@types/passport-auth-token/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ interface IVerifyOptions {

type VerifyFunction = (
token: string,
// tslint:disable-next-line:no-any
done: (error: any, user?: any, options?: IVerifyOptions) => void
) => void;

Expand Down
2 changes: 0 additions & 2 deletions src/__mocks__/request.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// tslint:disable:no-any

/**
* mockReq
* @returns {{header, accepts, acceptsEncodings, acceptsEncoding, acceptsCharsets, acceptsCharset, acceptsLanguages, acceptsLanguage, range, param, is, reset: resetMock}}
Expand Down
2 changes: 0 additions & 2 deletions src/__mocks__/response.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// tslint:disable:no-any

/**
* mockRes
* @returns {{append, attachment, cookie, clearCookie, download, end, format, get, json, jsonp, links, location, redirect, render, send, sendFile, sendStatus, set, status, type, vary, reset: resetMock}}
Expand Down
Loading

0 comments on commit 925e59f

Please sign in to comment.