From b5636ca6aff030cda78719dc4f3b457900bedfaf Mon Sep 17 00:00:00 2001 From: Mavaddat Javid Date: Wed, 9 Feb 2022 13:35:28 -0800 Subject: [PATCH 1/3] convert from tslint usage: ```sh eslint --fix --config .\.eslintrc.js ``` --- .eslintrc.js | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..aabe752 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,111 @@ +/* +👋 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 + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint", + "@typescript-eslint/tslint" + ], + "rules": { + "@typescript-eslint/indent": [ + "error", + 2 + ], + "@typescript-eslint/member-delimiter-style": [ + "error", + { + "multiline": { + "delimiter": "semi", + "requireLast": true + }, + "singleline": { + "delimiter": "semi", + "requireLast": false + } + } + ], + "@typescript-eslint/naming-convention": "error", + "@typescript-eslint/prefer-namespace-keyword": "error", + "@typescript-eslint/quotes": [ + "error", + "single", + { + "avoidEscape": true + } + ], + "@typescript-eslint/semi": [ + "error", + "always" + ], + "@typescript-eslint/type-annotation-spacing": "error", + "arrow-parens": [ + "error", + "always" + ], + "brace-style": [ + "error", + "1tbs" + ], + "comma-dangle": "error", + "eqeqeq": [ + "error", + "smart" + ], + "id-denylist": [ + "error", + "any", + "Number", + "number", + "String", + "string", + "Boolean", + "boolean", + "Undefined", + "undefined" + ], + "id-match": "error", + "indent": "error", + "no-eval": "error", + "no-redeclare": "error", + "no-trailing-spaces": "off", + "no-underscore-dangle": "error", + "no-var": "error", + "prefer-const": "error", + "quotes": "error", + "semi": "error", + "@typescript-eslint/tslint/config": [ + "error", + { + "rules": { + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ] + } + } + ] + } +}; From 4d48b737e4c6d7131487c9fbb24a2ef93722fb1e Mon Sep 17 00:00:00 2001 From: Mavaddat Javid Date: Wed, 9 Feb 2022 13:36:42 -0800 Subject: [PATCH 2/3] log output of tslint-to-eslint-config --- tslint-to-eslint-config.log | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tslint-to-eslint-config.log diff --git a/tslint-to-eslint-config.log b/tslint-to-eslint-config.log new file mode 100644 index 0000000..91a7e44 --- /dev/null +++ b/tslint-to-eslint-config.log @@ -0,0 +1,10 @@ +3 ESLint rules behave differently from their TSLint counterparts: + * brace-style: + - ESLint's brace-style will check all tokens. + * eqeqeq: + - Option "smart" allows for comparing two literal values, evaluating the value of typeof and null comparisons. + * no-underscore-dangle: + - Leading or trailing underscores (_) on identifiers will now be forbidden. + +1 rule is not known by tslint-to-eslint-config to have an ESLint equivalent: + * tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "whitespace". From f2f0ea630f4ec4a45502ab5b0734c4437861b385 Mon Sep 17 00:00:00 2001 From: Mavaddat Javid Date: Wed, 9 Feb 2022 14:03:34 -0800 Subject: [PATCH 3/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ce52958..76dfbc8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "types": "lib/rough-notation.d.ts", "scripts": { "build": "rm -rf lib && tsc && rollup -c", - "lint": "tslint -p tsconfig.json", + "lint": "eslint --fix --config .eslintrc.js", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": {