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

migrate deprecated tslint to typescript-eslint #12

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jubeatwww
Copy link
Collaborator

  • chore: 🤖 Change config file with tslint-to-eslint-config npx
    • use npx tslint-to-eslint-config --tslint .tslint.json to generate .eslintrc.js automatically
    • add required plugins for @typescript-eslint
  • chore: 🤖 add ESLint recommended rules and airbnb base
    • add rules that recommended by ESLint teams by adding extensions
    • add airbnb config base extension
  • chore: 🤖 add linting script
    • add script to package.json to run eslint
  • style: 💄 eslint auto fix
    • run eslint with --fix flag
  • style: 💄 fix some linting that won't change logic
    • remove rules that are not needed
    • ignore some rules that are not that important for now
    • fix some feature without changing original code logic

@@ -9,7 +9,8 @@
"type:declaration": "tsc --noEmit false --emitDeclarationOnly --declaration --declarationDir ./dist",
"test": "cross-env TS_NODE_PROJECT=tsconfig.test.json mocha ./test/index.ts",
"build": "$npm_execpath run build:babel && $npm_execpath run type:declaration",
"build:babel": "cross-env NODE_ENV=production babel ./src --out-dir ./dist --extensions '.ts'"
"build:babel": "cross-env NODE_ENV=production babel ./src --out-dir ./dist --extensions '.ts'",
"linting": "eslint ./src/** --ext .ts"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use lint.

eslint ./src --ext .ts

@@ -246,10 +241,10 @@ class Bot extends EventEmitter {
if (getLine(21).str.includes('密碼不對或無此帳號')) {
this.emit('login.failed');
return false;
} else if (getLine(23).str.includes('請稍後再試')) {
} if (getLine(23).str.includes('請稍後再試')) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we disable no-else-return rule?

},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./tsconfig.json is preferred

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants