Skip to content

Commit 63d37b9

Browse files
authored
feat!: upgrade eslint v8 (fixes #61) (#99)
* feat!: upgrade eslint v8 (fixes #61) the main change is to replace eslint.CliEngine to eslint.ESLint, as CLIEngine has been removed. refs: https://eslint.org/docs/8.0.0/user-guide/migrating-to-8.0.0#remove-cliengine * fix: upgrade eslint-config-react-app forked eslint-config-react-app v7.0.0, as it was breaking `dts lint`
1 parent 2708edd commit 63d37b9

File tree

15 files changed

+2021
-1383
lines changed

15 files changed

+2021
-1383
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/node_modules/
22
dist/
33
/docs
4+
# fixtures/
5+
/conf/eslint-config-react-app/

.eslintrc.js

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

.vscode/launch.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch via NPM",
9+
"request": "launch",
10+
"runtimeArgs": [
11+
"run-script",
12+
"lint:post-build"
13+
],
14+
"runtimeExecutable": "npm",
15+
"skipFiles": [
16+
"<node_internals>/**"
17+
],
18+
"type": "pwa-node"
19+
},
20+
{
21+
"type": "pwa-node",
22+
"request": "launch",
23+
"name": "Launch Program",
24+
"skipFiles": [
25+
"<node_internals>/**"
26+
],
27+
"program": "${workspaceFolder}/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js",
28+
"outFiles": [
29+
"${workspaceFolder}/**/*.js"
30+
]
31+
}
32+
]
33+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Despite all the recent hype, setting up a new TypeScript (x React) library can b
2424
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2525
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
2626

27+
2728
- [Features](#features)
2829
- [Quick Start](#quick-start)
2930
- [`npm start` or `yarn start`](#npm-start-or-yarn-start)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2013-present, Facebook, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# eslint-config-react-app
2+
3+
forked from eslint-config-react-app. the main changes:
4+
5+
* removed @rushstack/eslint-patch, as it was breaking `dts lint`.
6+
* removed @babel/eslint-parser.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
'use strict';
9+
10+
// removed it as it was breaking `dts lint`
11+
// Fix eslint shareable config (https://github.com/eslint/eslint/issues/3458)
12+
// require('@rushstack/eslint-patch/modern-module-resolution');
13+
14+
// This file contains the minimum ESLint configuration required for Create
15+
// React App support, and is used as the `baseConfig` for `eslint-loader`
16+
// to ensure that user-provided configs don't need this boilerplate.
17+
18+
module.exports = {
19+
root: true,
20+
21+
// parser: '@babel/eslint-parser',
22+
23+
plugins: ['react'],
24+
25+
env: {
26+
browser: true,
27+
commonjs: true,
28+
es6: true,
29+
jest: true,
30+
node: true,
31+
},
32+
33+
parserOptions: {
34+
sourceType: 'module',
35+
ecmaVersion: 'latest',
36+
ecmaFeatures: {
37+
jsx: true
38+
}
39+
},
40+
41+
settings: {
42+
react: {
43+
version: 'detect',
44+
},
45+
},
46+
47+
rules: {
48+
'react/jsx-uses-vars': 'warn',
49+
'react/jsx-uses-react': 'warn',
50+
},
51+
};

0 commit comments

Comments
 (0)