From dec185c6592334f6d530fb9ad57af2188962450e Mon Sep 17 00:00:00 2001 From: Pierre Neter Date: Fri, 16 Aug 2019 04:40:02 +0700 Subject: [PATCH 1/2] Bump version of @typescript-eslint/* --- packages/eslint-config-react-app/README.md | 2 +- packages/eslint-config-react-app/index.js | 8 +++++++- packages/eslint-config-react-app/package.json | 4 ++-- packages/react-scripts/package.json | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/eslint-config-react-app/README.md b/packages/eslint-config-react-app/README.md index a83a9ee924e..4ada3431245 100644 --- a/packages/eslint-config-react-app/README.md +++ b/packages/eslint-config-react-app/README.md @@ -19,7 +19,7 @@ If you want to use this ESLint configuration in a project not built with Create First, install this package, ESLint and the necessary plugins. ```sh -npm install --save-dev eslint-config-react-app @typescript-eslint/eslint-plugin@1.x @typescript-eslint/parser@1.x babel-eslint@10.x eslint@6.x eslint-plugin-flowtype@3.x eslint-plugin-import@2.x eslint-plugin-jsx-a11y@6.x eslint-plugin-react@7.x eslint-plugin-react-hooks@1.x +npm install --save-dev eslint-config-react-app @typescript-eslint/eslint-plugin@2.x @typescript-eslint/parser@2.x babel-eslint@10.x eslint@6.x eslint-plugin-flowtype@3.x eslint-plugin-import@2.x eslint-plugin-jsx-a11y@6.x eslint-plugin-react@7.x eslint-plugin-react-hooks@1.x ``` Then create a file named `.eslintrc.json` with following contents in the root folder of your project: diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index 210928d58c9..64d2b19a1de 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -78,7 +78,13 @@ module.exports = { 'no-undef': 'off', // Add TypeScript specific rules (and turn off ESLint equivalents) - '@typescript-eslint/no-angle-bracket-type-assertion': 'warn', + '@typescript-eslint/consistent-type-assertions': [ + 'warn', + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', + }, + ], 'no-array-constructor': 'off', '@typescript-eslint/no-array-constructor': 'warn', '@typescript-eslint/no-namespace': 'error', diff --git a/packages/eslint-config-react-app/package.json b/packages/eslint-config-react-app/package.json index e991f8d5589..657fbdd1b41 100644 --- a/packages/eslint-config-react-app/package.json +++ b/packages/eslint-config-react-app/package.json @@ -15,8 +15,8 @@ "index.js" ], "peerDependencies": { - "@typescript-eslint/eslint-plugin": "1.x", - "@typescript-eslint/parser": "1.x", + "@typescript-eslint/eslint-plugin": "2.x", + "@typescript-eslint/parser": "2.x", "babel-eslint": "10.x", "eslint": "6.x", "eslint-plugin-flowtype": "3.x", diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 6d86a6d8daa..8d11580a630 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -30,8 +30,8 @@ "dependencies": { "@babel/core": "7.5.5", "@svgr/webpack": "4.3.2", - "@typescript-eslint/eslint-plugin": "1.13.0", - "@typescript-eslint/parser": "1.13.0", + "@typescript-eslint/eslint-plugin": "2.0.0", + "@typescript-eslint/parser": "2.0.0", "babel-eslint": "10.0.2", "babel-jest": "^24.8.0", "babel-loader": "8.0.6", From b8364f662b7f653a06bf68d9da23edc833e72ca9 Mon Sep 17 00:00:00 2001 From: Pierre Neter Date: Tue, 10 Sep 2019 14:09:03 +0700 Subject: [PATCH 2/2] update --- packages/eslint-config-react-app/index.js | 8 +------- packages/react-scripts/package.json | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index 64d2b19a1de..419dc10e8d4 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -78,13 +78,7 @@ module.exports = { 'no-undef': 'off', // Add TypeScript specific rules (and turn off ESLint equivalents) - '@typescript-eslint/consistent-type-assertions': [ - 'warn', - { - assertionStyle: 'as', - objectLiteralTypeAssertions: 'allow', - }, - ], + '@typescript-eslint/consistent-type-assertions': 'warn', 'no-array-constructor': 'off', '@typescript-eslint/no-array-constructor': 'warn', '@typescript-eslint/no-namespace': 'error', diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 8d11580a630..ff48e08fcf7 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -30,8 +30,8 @@ "dependencies": { "@babel/core": "7.5.5", "@svgr/webpack": "4.3.2", - "@typescript-eslint/eslint-plugin": "2.0.0", - "@typescript-eslint/parser": "2.0.0", + "@typescript-eslint/eslint-plugin": "^2.2.0", + "@typescript-eslint/parser": "^2.2.0", "babel-eslint": "10.0.2", "babel-jest": "^24.8.0", "babel-loader": "8.0.6",