Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert from tslint #68

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
]
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
10 changes: 10 additions & 0 deletions tslint-to-eslint-config.log
Original file line number Diff line number Diff line change
@@ -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".