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

upgrade parser & plugin to 2.19.0 #224

Merged
merged 4 commits into from
Feb 11, 2020
Merged
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"TypeScript"
],
"dependencies": {
"@typescript-eslint/parser": "^2.16.0",
"@typescript-eslint/parser": "^2.19.2",
"eslint-config-standard": "^14.1.0"
},
"peerDependencies": {
Expand All @@ -64,14 +64,14 @@
"eslint-plugin-node": ">=9.1.0",
"eslint-plugin-promise": ">=4.2.1",
"eslint-plugin-standard": ">=4.0.0",
"@typescript-eslint/eslint-plugin": ">=2.16.0"
"@typescript-eslint/eslint-plugin": ">=2.19.2"
},
"devDependencies": {
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"@commitlint/travis-cli": "^8.2.0",
"@types/node": "^13.1.0",
"@typescript-eslint/eslint-plugin": "^2.16.0",
"@typescript-eslint/eslint-plugin": "^2.19.2",
"ava": "^3.1.0",
"editorconfig-checker": "^3.0.3",
"eslint": "^6.7.2",
Expand Down
8 changes: 7 additions & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ test('export', (t): void => {
rules: {
'brace-style': 'off',
camelcase: 'off',
'comma-spacing': 'off',
'default-param-last': 'off',
indent: 'off',
'no-array-constructor': 'off',
'no-duplicate-class-members': 'off',
'no-dupe-class-members': 'off',
'no-throw-literal': 'off',
'no-undef': 'off',
'no-unused-vars': 'off',
Expand All @@ -48,6 +50,7 @@ test('export', (t): void => {
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'@typescript-eslint/camelcase': ['error', { properties: 'never', genericType: 'always' }],
'@typescript-eslint/comma-spacing': ['error', { before: false, after: true }],
'@typescript-eslint/consistent-type-assertions': [
'error',
{
Expand Down Expand Up @@ -86,6 +89,7 @@ test('export', (t): void => {
}
],
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-dupe-class-members': 'error',
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! 👍

'@typescript-eslint/no-dynamic-delete': 'error',
'@typescript-eslint/no-empty-function': ['error', {
allow: [
Expand All @@ -102,10 +106,12 @@ test('export', (t): void => {
'@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',
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't do anything at the moment since @typescript-eslint/no-non-null-assertion makes it so that you can never come here. But it's still nice to enable it, since we might change @typescript-eslint/no-non-null-assertion in the future 👍

'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-this-alias': ['error', { allowDestructuring: true }],
'@typescript-eslint/no-throw-literal': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat 👍

'@typescript-eslint/no-unused-vars': ['error', { vars: 'all', args: 'none', ignoreRestSiblings: true }],
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false, enums: false, variables: false, typedefs: false }],
'@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true, allowTaggedTemplates: true, allowTernary: true }],
Expand Down
8 changes: 5 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { rules as standardRules } from 'eslint-config-standard/eslintrc.json'

const equivalents = [
'comma-spacing',
'brace-style',
'indent',
'no-array-constructor',
'no-dupe-class-members',
'no-throw-literal',
'no-unused-vars',
'no-unused-expressions',
Expand All @@ -30,12 +32,10 @@ export = {
// TypeScript has this functionality by default:
'no-undef': 'off',

// Incompatible with TypeScript function overloads:
'no-duplicate-class-members': 'off',

// Rules replaced by @typescript-eslint versions:
...fromEntries(equivalents.map((name) => [name, 'off'])),
camelcase: 'off',
'default-param-last': 'off',
'no-use-before-define': 'off',

// @typescript-eslint versions of Standard.js rules:
Expand Down Expand Up @@ -90,8 +90,10 @@ export = {
'@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': 'error',
'@typescript-eslint/no-this-alias': ['error', { allowDestructuring: true }],
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-function-type': 'error',
Expand Down