Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.

Commit d52dd2b

Browse files
committed
removed tslintuse eslint onlyadd FB eslint override fix facebook/create-react-app#7510
1 parent 8135da7 commit d52dd2b

File tree

5 files changed

+5
-194
lines changed

5 files changed

+5
-194
lines changed

packages/react-scripts/config/webpack.config.js

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -328,30 +328,6 @@ module.exports = function(webpackEnv) {
328328

329329
// First, run the linter.
330330
// It's important to do this before Babel processes the JS.
331-
// {
332-
// test: /\.(js|mjs|jsx)$/,
333-
// enforce: 'pre',
334-
// use: [
335-
// {
336-
// options: {
337-
// formatter: require.resolve('react-dev-utils/eslintFormatter'),
338-
// eslintPath: require.resolve('eslint'),
339-
// // @remove-on-eject-begin
340-
// baseConfig: {
341-
// extends: [require.resolve('eslint-config-react-app')],
342-
// },
343-
// ignore: false,
344-
// useEslintrc: false,
345-
// // @remove-on-eject-end
346-
// },
347-
// loader: require.resolve('eslint-loader'),
348-
// },
349-
// ],
350-
// include: paths.appSrc,
351-
// },
352-
// AAA:
353-
// we don't need the eslint linter for normal js file, but the typescript linter!
354-
// potentially disable when https://github.com/facebook/create-react-app/issues/5641 gets merged!
355331
{
356332
test: /\.(js|mjs|jsx|ts|tsx)$/,
357333
enforce: 'pre',
@@ -371,14 +347,8 @@ module.exports = function(webpackEnv) {
371347
// A config couldn't be found.
372348
}
373349

374-
// We allow overriding the config, only if it extends our config
375-
// (`extends` can be a string or array of strings).
376-
if (
377-
process.env.EXTEND_ESLINT &&
378-
eslintConfig &&
379-
eslintConfig.extends &&
380-
eslintConfig.extends.includes('react-app')
381-
) {
350+
// We allow overriding the config only if the env variable is set
351+
if (process.env.EXTEND_ESLINT && eslintConfig) {
382352
return eslintConfig;
383353
} else {
384354
return {

packages/react-scripts/scripts/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ module.exports = function(
102102

103103
// Setup the script rules
104104
appPackage.scripts = {
105-
start: 'aaa-react-scripts-ts start',
106-
build: 'aaa-react-scripts-ts build',
105+
start: 'EXTEND_ESLINT=true aaa-react-scripts-ts start',
106+
build: 'EXTEND_ESLINT=true aaa-react-scripts-ts build',
107107
test: 'aaa-react-scripts-ts test --env=jsdom',
108108
eject: 'aaa-react-scripts-ts eject',
109109
apollo: 'apollo',

packages/react-scripts/template-typescript/.eslintrc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
"plugin:@typescript-eslint/recommended",
44
"react-app"
55
],
6-
"plugins": [
7-
"@typescript-eslint",
8-
"@typescript-eslint/tslint"
9-
],
10-
"parser": "@typescript-eslint/parser",
116
"parserOptions": {
127
"project": "./tsconfig.json"
138
},
@@ -20,12 +15,6 @@
2015
"@typescript-eslint/no-var-requires": "off",
2116
"@typescript-eslint/explicit-function-return-type": "off",
2217
"@typescript-eslint/no-explicit-any": "off",
23-
"@typescript-eslint/no-unused-vars": "off",
24-
"@typescript-eslint/tslint/config": [
25-
"warn",
26-
{
27-
"lintFile": "./tslint.json"
28-
}
29-
]
18+
"@typescript-eslint/no-unused-vars": "off"
3019
}
3120
}

packages/react-scripts/template-typescript/.template.dependencies.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@
3030
"@types/react-router": "^5.0.3",
3131
"@types/react-router-dom": "^4.3.1",
3232
"@types/webpack-env": "1.14.0",
33-
"@typescript-eslint/eslint-plugin": "^1.3.0",
34-
"@typescript-eslint/eslint-plugin-tslint": "^1.3.0",
35-
"@typescript-eslint/parser": "^1.3.0",
36-
"tslint": "^5.12.1",
37-
"tslint-microsoft-contrib": "^6.0.0",
38-
"tslint-react": "^4.0.0",
3933
"typescript": "^3.3.3"
4034
},
4135
"resolutions": {

packages/react-scripts/template-typescript/tslint.json

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)