Skip to content

Commit

Permalink
feat!: upgrade eslint v8 (fixes #61) (#99)
Browse files Browse the repository at this point in the history
* 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`
  • Loading branch information
aladdin-add committed Dec 16, 2021
1 parent 2708edd commit 63d37b9
Show file tree
Hide file tree
Showing 15 changed files with 2,021 additions and 1,383 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
@@ -1,3 +1,5 @@
/node_modules/
dist/
/docs
# fixtures/
/conf/eslint-config-react-app/
3 changes: 0 additions & 3 deletions .eslintrc.js

This file was deleted.

33 changes: 33 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,33 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch via NPM",
"request": "launch",
"runtimeArgs": [
"run-script",
"lint:post-build"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
},
{
"type": "pwa-node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js",
"outFiles": [
"${workspaceFolder}/**/*.js"
]
}
]
}
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -24,6 +24,7 @@ Despite all the recent hype, setting up a new TypeScript (x React) library can b
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [Features](#features)
- [Quick Start](#quick-start)
- [`npm start` or `yarn start`](#npm-start-or-yarn-start)
Expand Down
21 changes: 21 additions & 0 deletions conf/eslint-config-react-app/LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2013-present, Facebook, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions conf/eslint-config-react-app/README.md
@@ -0,0 +1,6 @@
# eslint-config-react-app

forked from eslint-config-react-app. the main changes:

* removed @rushstack/eslint-patch, as it was breaking `dts lint`.
* removed @babel/eslint-parser.
51 changes: 51 additions & 0 deletions conf/eslint-config-react-app/base.js
@@ -0,0 +1,51 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

// removed it as it was breaking `dts lint`
// Fix eslint shareable config (https://github.com/eslint/eslint/issues/3458)
// require('@rushstack/eslint-patch/modern-module-resolution');

// This file contains the minimum ESLint configuration required for Create
// React App support, and is used as the `baseConfig` for `eslint-loader`
// to ensure that user-provided configs don't need this boilerplate.

module.exports = {
root: true,

// parser: '@babel/eslint-parser',

plugins: ['react'],

env: {
browser: true,
commonjs: true,
es6: true,
jest: true,
node: true,
},

parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
ecmaFeatures: {
jsx: true
}
},

settings: {
react: {
version: 'detect',
},
},

rules: {
'react/jsx-uses-vars': 'warn',
'react/jsx-uses-react': 'warn',
},
};

0 comments on commit 63d37b9

Please sign in to comment.