Switched from tslint to eslint

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2020-02-06 16:58:25 +01:00
parent 8e1add81fc
commit 6ae2cd7ee6
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16
5 changed files with 770 additions and 800 deletions

4
.eslintignore Normal file
View File

@ -0,0 +1,4 @@
node_modules
out
.next

201
.eslintrc.js Normal file
View File

@ -0,0 +1,201 @@
module.exports = {
env: {
browser: true,
es6: true,
node: true
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly"
},
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018,
sourceType: "module"
},
settings: {
react: {
version: "detect"
}
},
plugins: [
"react",
"@typescript-eslint"
],
rules: {
indent: [
"error",
"tab"
],
"linebreak-style": [
"error",
"unix"
],
quotes: [
"error",
"single"
],
semi: [
"error",
"never"
],
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": [
"error",
{
default: 'generic'
}
],
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
accessibility: "explicit"
}
],
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/member-delimiter-style": [
"error",
{
multiline: {
delimiter: "none",
requireLast: true
},
singleline: {
delimiter: "semi",
requireLast: false
}
}
],
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": [
"error",
"single",
{
avoidEscape: true
}
],
"@typescript-eslint/semi": [
"error",
"never"
],
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": "error",
"arrow-parens": [
"error",
"as-needed"
],
camelcase: "error",
"comma-dangle": [
"error",
"always-multiline"
],
complexity: "off",
"constructor-super": "error",
curly: "error",
"dot-notation": "error",
"eol-last": "error",
eqeqeq: [
"error",
"smart"
],
"guard-for-in": "error",
"id-blacklist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined"
],
"id-match": "error",
"max-classes-per-file": [
"error",
1
],
"max-len": [
"error",
{
code: 120
}
],
"new-parens": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": "error",
"no-debugger": "error",
"no-empty": "error",
"no-eval": "error",
"no-fallthrough": "off",
"no-invalid-this": "off",
"no-multiple-empty-lines": "error",
"no-new-wrappers": "error",
"no-shadow": [
"error",
{
hoist: "all"
}
],
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-underscore-dangle": "error",
"no-unsafe-finally": "error",
"no-unused-expressions": "error",
"no-unused-labels": "error",
"no-unused-vars": "off",
"no-var": "error",
"object-shorthand": "error",
"one-var": [
"error",
"never"
],
"prefer-const": "error",
"quote-props": [
"error",
"consistent-as-needed"
],
"radix": "error",
"space-before-function-paren": [
"error",
{
anonymous: "never",
asyncArrow: "always",
named: "never"
}
],
"spaced-comment": "error",
"use-isnan": "error",
"valid-typeof": "off",
}
};

View File

@ -5,12 +5,12 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"export": "next export && node export.js && yarn move_next",
"export": "next export && node scripts/export && yarn move_next && node scripts/generateSitemap",
"start": "next start",
"move_next": "mv out/_next out/assets",
"serve": "serve out",
"prod": "yarn build && yarn export && yarn serve",
"lint": "tslint -c tslint.json --project tsconfig.json"
"lint": "eslint . --ext .ts,.tsx"
},
"dependencies": {
"@zeit/next-stylus": "^1.0.1",
@ -23,7 +23,6 @@
"imagemin-optipng": "^7.1.0",
"imagemin-svgo": "^7.0.0",
"jimp": "^0.9.3",
"lqip-loader": "^2.2.0",
"next": "^9.1.7",
"next-offline": "^5.0.0",
"next-optimized-images": "^2.5.4",
@ -38,7 +37,6 @@
"responsive-loader": "^1.2.0",
"serve": "^11.3.0",
"stylus": "^0.54.7",
"svg-sprite-loader": "^4.1.6",
"ts-node": "^8.6.2",
"typescript": "^3.7.4",
"webp-loader": "^0.6.0",
@ -48,6 +46,9 @@
"devDependencies": {
"@types/node": "^13.1.4",
"@types/react": "^16.9.17",
"tslint": "^5.20.1"
"@typescript-eslint/eslint-plugin": "^2.19.0",
"@typescript-eslint/parser": "^2.19.0",
"eslint": "^6.8.0",
"eslint-plugin-react": "^7.18.3"
}
}

View File

@ -1,18 +0,0 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"indent": [
true,
"tabs"
],
"semicolon": [true, "never"],
"quotemark": [true, "single", "jsx-double", "avoid-escape"],
"interface-name": [false],
"array-type": [true, "generic"]
},
"rulesDirectory": []
}

1336
yarn.lock

File diff suppressed because it is too large Load Diff