Create initial ESlint configuration with tslint-to-eslint-config

This commit is contained in:
MatiasStorm 2020-06-06 11:37:14 +02:00
parent 4df8fd0ee4
commit 670fc2f3de
4 changed files with 1048 additions and 11 deletions

320
.eslintrc.js Normal file
View file

@ -0,0 +1,320 @@
/*
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config
It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.
We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
Happy linting! 💖
*/
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
"prettier/@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"@typescript-eslint/tslint"
],
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": [
"error",
{
"default": "array-simple"
}
],
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"Object": {
"message": "Avoid using the `Object` type. Did you mean `object`?"
},
"Function": {
"message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
},
"Boolean": {
"message": "Avoid using the `Boolean` type. Did you mean `boolean`?"
},
"Number": {
"message": "Avoid using the `Number` type. Did you mean `number`?"
},
"String": {
"message": "Avoid using the `String` type. Did you mean `string`?"
},
"Symbol": {
"message": "Avoid using the `Symbol` type. Did you mean `symbol`?"
}
}
}
],
"@typescript-eslint/class-name-casing": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/explicit-module-boundary-types": "warn",
"@typescript-eslint/indent": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/member-delimiter-style": [
"off",
{
"multiline": {
"delimiter": "none",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/no-extra-semi": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-implied-eval": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unsafe-assignment": "error",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/prefer-regexp-exec": "error",
"@typescript-eslint/quotes": [
"error",
"double",
{
"avoidEscape": true
}
],
"@typescript-eslint/require-await": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/restrict-template-expressions": "error",
"@typescript-eslint/semi": [
"off",
null
],
"@typescript-eslint/triple-slash-reference": [
"error",
{
"path": "always",
"types": "prefer-import",
"lib": "always"
}
],
"@typescript-eslint/tslint/config": [
"error",
{
"rules": {
"arguments-order": true,
"bool-param-default": true,
"consecutive-overloads": true,
"import-spacing": true,
"max-switch-cases": true,
"no-accessor-field-mismatch": true,
"no-all-duplicated-branches": true,
"no-alphabetical-sort": true,
"no-case-with-or": true,
"no-collapsible-if": true,
"no-collection-size-mischeck": true,
"no-dead-store": true,
"no-duplicate-in-composite": true,
"no-duplicated-branches": true,
"no-element-overwrite": true,
"no-empty-array": true,
"no-empty-destructuring": true,
"no-gratuitous-expressions": true,
"no-hardcoded-credentials": true,
"no-identical-conditions": true,
"no-identical-expressions": true,
"no-identical-functions": true,
"no-ignored-initial-value": true,
"no-ignored-return": true,
"no-in-misuse": true,
"no-invalid-await": true,
"no-invariant-return": true,
"no-inverted-boolean-check": true,
"no-misleading-array-reverse": true,
"no-misspelled-operator": true,
"no-multiline-string-literals": true,
"no-nested-switch": true,
"no-nested-template-literals": true,
"no-redundant-boolean": true,
"no-redundant-jump": true,
"no-redundant-parentheses": true,
"no-return-type-any": true,
"no-same-line-conditional": true,
"no-self-assignment": true,
"no-small-switch": true,
"no-statements-same-line": true,
"no-try-promise": true,
"no-unconditional-jump": true,
"no-undefined-argument": true,
"no-unenclosed-multiline-block": true,
"no-unthrown-error": true,
"no-unused-array": true,
"no-unused-declaration": true,
"no-use-of-empty-return-value": true,
"no-useless-cast": true,
"no-useless-catch": true,
"no-useless-increment": true,
"no-useless-intersection": true,
"no-variable-usage-before-declaration": true,
"parameters-max-number": true,
"prefer-default-last": true,
"prefer-immediate-return": true,
"prefer-optional": true,
"prefer-promise-shorthand": true,
"prefer-type-guard": true,
"use-primitive-type": true,
"use-type-alias": true,
"whitespace": true
}
}
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": "error",
"arrow-parens": [
"off",
"always"
],
"brace-style": [
"error",
"1tbs"
],
"camelcase": "off",
"comma-dangle": "off",
"complexity": "off",
"constructor-super": "error",
"curly": "off",
"eol-last": "error",
"eqeqeq": [
"off",
"always"
],
"guard-for-in": "error",
"id-blacklist": "off",
"id-match": "off",
"import/order": "off",
"jsdoc/check-alignment": "off",
"jsdoc/check-indentation": "off",
"jsdoc/newline-after-description": "off",
"max-classes-per-file": "off",
"max-len": "off",
"new-parens": "error",
"no-array-constructor": "off",
"no-bitwise": "error",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": "off",
"no-debugger": "error",
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-empty-function": "off",
"no-eval": "off",
"no-extra-semi": "off",
"no-fallthrough": "off",
"no-invalid-this": "off",
"no-multiple-empty-lines": "error",
"no-new-wrappers": "error",
"no-shadow": [
"off",
{
"hoist": "all"
}
],
"no-throw-literal": "off",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-unsafe-finally": "off",
"no-unused-labels": "error",
"no-unused-vars": "off",
"no-var": "error",
"object-shorthand": "error",
"one-var": [
"error",
"never"
],
"prefer-arrow/prefer-arrow-functions": "off",
"prefer-const": [
"error",
{
"destructuring": "all"
}
],
"quote-props": "off",
"radix": "error",
"require-await": "off",
"space-before-function-paren": [
"error",
{
"anonymous": "never",
"asyncArrow": "always",
"named": "never"
}
],
"spaced-comment": [
"error",
"always",
{
"markers": [
"/"
]
}
],
"use-isnan": "error",
"valid-typeof": "off"
}
};

View file

@ -23,8 +23,16 @@
"@types/mithril": "^2.0.3",
"@types/node": "^14.0.6",
"@types/selenium-webdriver": "^4.0.9",
"@typescript-eslint/eslint-plugin": "^3.1.0",
"@typescript-eslint/eslint-plugin-tslint": "^3.1.0",
"@typescript-eslint/parser": "^3.1.0",
"cleanslate": "^0.10.1",
"copy-webpack-plugin": "^6.0.1",
"eslint": "^7.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsdoc": "^27.0.4",
"eslint-plugin-prefer-arrow": "^1.2.1",
"geckodriver": "^1.19.1",
"jest": "^25.5.4",
"jest-webextension-mock": "^3.6.0",

View file

@ -0,0 +1,78 @@
5 ESLint rules behave differently from their TSLint counterparts:
* @typescript-eslint/no-unused-expressions:
- The TSLint optional config "allow-new" is the default ESLint behavior and will no longer be ignored.
* camelcase:
- Leading and trailing underscores (_) in variable names will now be ignored.
* no-invalid-this:
- Functions in methods will no longer be ignored.
* no-underscore-dangle:
- Leading or trailing underscores (_) on identifiers will now be forbidden.
* space-before-function-paren:
- Option "constructor" is not supported by ESLint.
- Option "method" is not supported by ESLint.
63 rules are not known by tslint-to-eslint-config to have ESLint equivalents:
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "arguments-order".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "bool-param-default".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "consecutive-overloads".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "import-spacing".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "max-switch-cases".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-accessor-field-mismatch".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-all-duplicated-branches".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-alphabetical-sort".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-case-with-or".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-collapsible-if".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-collection-size-mischeck".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-dead-store".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-duplicate-in-composite".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-duplicated-branches".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-element-overwrite".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-empty-array".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-empty-destructuring".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-gratuitous-expressions".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-hardcoded-credentials".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-identical-conditions".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-identical-expressions".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-identical-functions".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-ignored-initial-value".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-ignored-return".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-in-misuse".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-invalid-await".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-invariant-return".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-inverted-boolean-check".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-misleading-array-reverse".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-misspelled-operator".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-multiline-string-literals".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-nested-switch".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-nested-template-literals".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-redundant-boolean".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-redundant-jump".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-redundant-parentheses".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-return-type-any".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-same-line-conditional".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-self-assignment".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-small-switch".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-statements-same-line".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-try-promise".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-unconditional-jump".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-undefined-argument".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-unenclosed-multiline-block".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-unthrown-error".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-unused-array".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-unused-declaration".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-use-of-empty-return-value".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-useless-cast".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-useless-catch".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-useless-increment".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-useless-intersection".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "no-variable-usage-before-declaration".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "parameters-max-number".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "prefer-default-last".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "prefer-immediate-return".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "prefer-optional".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "prefer-promise-shorthand".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "prefer-type-guard".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "use-primitive-type".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "use-type-alias".
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "whitespace".

653
yarn.lock

File diff suppressed because it is too large Load diff