Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: eggjs/eslint-config-egg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 23142f18151922400e3905b5d87ba20272ae7919
Choose a base ref
...
head repository: eggjs/eslint-config-egg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 649f71cae440b658bd3b789adb29e3e2e9475fd1
Choose a head ref
  • 15 commits
  • 43 files changed
  • 8 contributors

Commits on Sep 10, 2019

  1. Copy the full SHA
    664eead View commit details

Commits on Dec 3, 2019

  1. Verified

    This commit was signed with the committer’s verified signature.
    targos Michaël Zasso
    Copy the full SHA
    4f5852c View commit details
  2. Release 8.0.0

    popomore committed Dec 3, 2019
    Copy the full SHA
    749e46e View commit details

Commits on Jan 20, 2020

  1. fix: unused vars rule (#50)

    * fix: unused-vars is now valid
    
    * chore: update CI generated config
    
    * feat: turn on unused-vars check
    
    * chore: force CI refresh
    
    * feat: unused-vars should check local variables only
    
    * fix: update trailing comma test case
    sang4lv authored and whxaxes committed Jan 20, 2020
    Copy the full SHA
    2591d1d View commit details
  2. Release 8.0.1

    whxaxes committed Jan 20, 2020
    Copy the full SHA
    483777e View commit details

Commits on Aug 28, 2020

  1. Copy the full SHA
    4215571 View commit details
  2. Release 8.1.0

    whxaxes committed Aug 28, 2020
    Copy the full SHA
    e9ddf88 View commit details

Commits on Aug 31, 2020

  1. fix: reduce type check (#54)

    whxaxes authored Aug 31, 2020
    Copy the full SHA
    c941ab1 View commit details
  2. Release 8.1.1

    whxaxes committed Aug 31, 2020
    Copy the full SHA
    df0bdb2 View commit details
  3. fix: semi rules (#55)

    whxaxes authored Aug 31, 2020
    Copy the full SHA
    c12391c View commit details

Commits on Sep 1, 2020

  1. Release 8.1.2

    whxaxes committed Sep 1, 2020
    Copy the full SHA
    1235d9a View commit details

Commits on Nov 11, 2020

  1. feat: 修改 rules/node 中已被 eslint 废弃的 node rules,引入 eslint-plugin-node 及…

    …自定规则 (#57)
    
    * fix(node): 修改已被 eslint 废弃的 node rules,增加 eslint-plugin-node 及自定规则
    * style(node): 修改代码格式
    * fix: 关闭 prefer-global 对不常用变量的限制
    
    Co-authored-by: 年翼 <nianyi.zxy@alibaba-inc.com>
    zhaoxingyue and 年翼 authored Nov 11, 2020
    Copy the full SHA
    f4bcafe View commit details
  2. Release 9.0.0

    popomore committed Nov 11, 2020
    Copy the full SHA
    15b93ad View commit details

Commits on Nov 24, 2021

  1. feat: support eslint 8 (#59)

    drop node 10 support
    ShadyZOZ authored Nov 24, 2021
    Copy the full SHA
    bca9686 View commit details
  2. Release 10.0.0

    fengmk2 committed Nov 24, 2021
    Copy the full SHA
    649f71c View commit details
Showing with 714 additions and 98 deletions.
  1. +11 −6 .autod.conf.js
  2. +46 −0 .github/workflows/nodejs.yml
  3. +3 −3 .travis.yml
  4. +43 −0 History.md
  5. +19 −16 README.md
  6. +2 −2 appveyor.yml
  7. +2 −1 index.js
  8. +7 −0 lib/rules/es2020.js
  9. +0 −7 lib/rules/esnext.js
  10. +195 −31 lib/rules/node.js
  11. +48 −1 lib/rules/typescript.js
  12. +19 −16 package.json
  13. +1 −1 react.js
  14. +15 −0 test/es2020.test.js
  15. +3 −0 test/fixtures/es2020/.eslintrc
  16. +7 −0 test/fixtures/es2020/bigint.js
  17. +3 −0 test/fixtures/node-app/.eslintrc
  18. +4 −0 test/fixtures/node-app/no-new-require-fail.js
  19. +4 −0 test/fixtures/node-app/no-new-require.js
  20. +22 −0 test/fixtures/node-app/prefer-global-fail.js
  21. +9 −0 test/fixtures/node-app/prefer-global.js
  22. +16 −0 test/fixtures/node-app/prefer-promises-fail.js
  23. +16 −0 test/fixtures/node-app/prefer-promises.js
  24. +5 −0 test/fixtures/react-app/babel.config.json
  25. +1 −1 test/fixtures/ts-app/align/arguments.ts
  26. +1 −1 test/fixtures/ts-app/align/elements.ts
  27. +1 −1 test/fixtures/ts-app/align/members-error.ts
  28. +1 −1 test/fixtures/ts-app/align/members.ts
  29. +5 −1 test/fixtures/ts-app/align/parameters-error.ts
  30. +2 −0 test/fixtures/ts-app/align/parameters.ts
  31. +2 −0 test/fixtures/ts-app/align/statements.ts
  32. +11 −0 test/fixtures/ts-app/ban-types/correct.ts
  33. +11 −0 test/fixtures/ts-app/ban-types/not-correct.ts
  34. +7 −6 test/fixtures/ts-app/comma/trailing-comma.ts
  35. +6 −0 test/fixtures/ts-app/constructor/correct.ts
  36. +3 −0 test/fixtures/ts-app/constructor/not-correct.ts
  37. +9 −0 test/fixtures/ts-app/no-undef/correct.ts
  38. +10 −0 test/fixtures/ts-app/no-use-before-define/correct.ts
  39. +10 −0 test/fixtures/ts-app/no-use-before-define/not-correct.ts
  40. +1 −0 test/fixtures/ts-app/reference/unused-vars.ts
  41. +7 −0 test/fixtures/ts-app/semi/semi.ts
  42. +56 −0 test/node.test.js
  43. +70 −3 test/ts.test.js
17 changes: 11 additions & 6 deletions .autod.conf.js
Original file line number Diff line number Diff line change
@@ -11,18 +11,23 @@ module.exports = {
'docs',
],
dep: [
'@typescript-eslint/eslint-plugin',
'@typescript-eslint/parser',
'babel-eslint',
'eslint-plugin-eggache',
'eslint-plugin-import',
'eslint-plugin-react',
'eslint-plugin-jsdoc',
'eslint-plugin-jsx-a11y',
'eslint-plugin-eggache',
'eslint-plugin-node',
'eslint-plugin-react',
],
devdep: [
'autod',
'eslint',
'coffee',
'egg-bin',
'egg-ci',
],
semver: [
'egg-bin@1',
'eslint',
'git-contributor',
'typescript',
],
};
46 changes: 46 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
schedule:
- cron: '0 2 * * *'

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: [12, 14, 16]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout Git Source
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm i -g npminstall && npminstall

- name: Continuous Integration
run: npm run ci

- name: Code Coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sudo: false

language: node_js
node_js:
- '8'
- '10'
- '12'
- '14'
- '16'
before_install:
- npm i npminstall -g
install:
43 changes: 43 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,47 @@

10.0.0 / 2021-11-24
==================

**features**
* [[`bca9686`](http://github.com/eggjs/eslint-config-egg/commit/bca9686b3e0e084a71078a60830409e97704899a)] - feat: support eslint 8 (#59) (shadyzoz <<shadyzoz@icloud.com>>)

9.0.0 / 2020-11-11
==================

**features**
* [[`f4bcafe`](http://github.com/eggjs/eslint-config-egg/commit/f4bcafebe46b6d4b9f259d7de7fe15af71f0bcca)] - feat: 修改 rules/node 中已被 eslint 废弃的 node rules,引入 eslint-plugin-node 及自定规则 (#57) (zhaoxingyue <<zxy.node.js@gmail.com>>)

8.1.2 / 2020-09-01
==================

**fixes**
* [[`c12391c`](http://github.com/eggjs/eslint-config-egg/commit/c12391ce4c974615f59cf7026b3e662a56f189b4)] - fix: semi rules (#55) (吖猩 <<whx89768@alibaba-inc.com>>)

8.1.1 / 2020-08-31
==================

**fixes**
* [[`c941ab1`](http://github.com/eggjs/eslint-config-egg/commit/c941ab15f2d74936e7c1fb4fd58b83866f70f24f)] - fix: reduce type check (#54) (吖猩 <<whx89768@alibaba-inc.com>>)

8.1.0 / 2020-08-28
==================

**features**
* [[`4215571`](http://github.com/eggjs/eslint-config-egg/commit/4215571a6c61c3c07fe443515a9e8704e23e8185)] - feat: upgrade typescript-eslint (#53) (吖猩 <<whx89768@alibaba-inc.com>>)

8.0.1 / 2020-01-20
==================

**fixes**
* [[`2591d1d`](http://github.com/eggjs/eslint-config-egg/commit/2591d1d2b64ba89c0a6f27b537d7706e5e4b3ce7)] - fix: unused vars rule (#50) (Angela <<idu.angela@gmail.com>>)

8.0.0 / 2019-12-03
==================

**features**
* [[`4f5852c`](http://github.com/eggjs/eslint-config-egg/commit/4f5852c481ad3b527636f9f168193646a76768b1)] - feat: [BREAKING_CHANGE] use ecma 2020 supporting bigint (#49) (Haoliang Gao <<sakura9515@gmail.com>>)
* [[`664eead`](http://github.com/eggjs/eslint-config-egg/commit/664eeadbb50c6fca78c5e443b2c2aa08057c1436)] - feat: no-this-alias allow self=this (#48) (Jing Cui <<cjing0620@gmail.com>>)

7.5.1 / 2019-08-27
==================

35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -15,8 +15,8 @@ npm i eslint eslint-config-egg --save-dev
```json
{
"devDependencies": {
"eslint-config-egg": "7",
"eslint": "4"
"eslint-config-egg": "10",
"eslint": "8"
}
}
```
@@ -36,8 +36,8 @@ module.exports = {
```json
{
"devDependencies": {
"eslint-config-egg": "7",
"typescript": "^3.5.3"
"eslint-config-egg": "8",
"typescript": "^4.5.2"
}
}
```
@@ -81,16 +81,17 @@ module.exports = {

### Use with Experimental Features

If you want to use eslint-config-egg with experimental features such as `async function`, you should use `babel-eslint` parser:
If you want to use eslint-config-egg with experimental features such as `async function`, you should use `@babel/eslint-parser` parser:

- `package.json`

```json
{
"devDependencies": {
"eslint-config-egg": "7",
"eslint": "4",
"babel-eslint": "8"
"eslint-config-egg": "10",
"eslint": "8",
"@babel/core": "7",
"@babel/eslint-parser": "7"
}
}
```
@@ -101,7 +102,7 @@ If you want to use eslint-config-egg with experimental features such as `async f
module.exports = {
extends: 'eslint-config-egg',
// for experimental features support
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
rules: {
// see https://github.com/eslint/eslint/issues/6274
'generator-star-spacing': 'off',
@@ -119,9 +120,10 @@ If you want to use eslint-config-egg with react, jsx and es6 modules:
```json
{
"devDependencies": {
"eslint-config-egg": "7",
"eslint": "4",
"babel-eslint": "8",
"eslint-config-egg": "10",
"eslint": "8",
"@babel/core": "7",
"@babel/eslint-parser": "7",
"eslint-plugin-react": "7"
}
}
@@ -133,7 +135,7 @@ If you want to use eslint-config-egg with react, jsx and es6 modules:
module.exports = {
extends: 'eslint-config-egg',
// for experimental features support
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
// for es6 module
sourceType: 'module',
@@ -159,10 +161,11 @@ module.exports = {

## Contributors

|[<img src="https://avatars1.githubusercontent.com/u/360661?v=4" width="100px;"/><br/><sub><b>popomore</b></sub>](https://github.com/popomore)<br/>|[<img src="https://avatars0.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars2.githubusercontent.com/u/227713?v=4" width="100px;"/><br/><sub><b>atian25</b></sub>](https://github.com/atian25)<br/>|[<img src="https://avatars0.githubusercontent.com/u/3580607?v=4" width="100px;"/><br/><sub><b>benjycui</b></sub>](https://github.com/benjycui)<br/>|[<img src="https://avatars0.githubusercontent.com/u/3274850?v=4" width="100px;"/><br/><sub><b>geekdada</b></sub>](https://github.com/geekdada)<br/>|[<img src="https://avatars3.githubusercontent.com/u/985607?v=4" width="100px;"/><br/><sub><b>dead-horse</b></sub>](https://github.com/dead-horse)<br/>|
|[<img src="https://avatars.githubusercontent.com/u/360661?v=4" width="100px;"/><br/><sub><b>popomore</b></sub>](https://github.com/popomore)<br/>|[<img src="https://avatars.githubusercontent.com/u/5856440?v=4" width="100px;"/><br/><sub><b>whxaxes</b></sub>](https://github.com/whxaxes)<br/>|[<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars.githubusercontent.com/u/227713?v=4" width="100px;"/><br/><sub><b>atian25</b></sub>](https://github.com/atian25)<br/>|[<img src="https://avatars.githubusercontent.com/u/3580607?v=4" width="100px;"/><br/><sub><b>benjycui</b></sub>](https://github.com/benjycui)<br/>|[<img src="https://avatars.githubusercontent.com/u/3274850?v=4" width="100px;"/><br/><sub><b>geekdada</b></sub>](https://github.com/geekdada)<br/>|
| :---: | :---: | :---: | :---: | :---: | :---: |
[<img src="https://avatars1.githubusercontent.com/u/10082151?v=4" width="100px;"/><br/><sub><b>bowei-jbw</b></sub>](https://github.com/bowei-jbw)<br/>|[<img src="https://avatars2.githubusercontent.com/u/13050025?v=4" width="100px;"/><br/><sub><b>aladdin-add</b></sub>](https://github.com/aladdin-add)<br/>|[<img src="https://avatars1.githubusercontent.com/u/143572?v=4" width="100px;"/><br/><sub><b>hotoo</b></sub>](https://github.com/hotoo)<br/>
|[<img src="https://avatars.githubusercontent.com/u/985607?v=4" width="100px;"/><br/><sub><b>dead-horse</b></sub>](https://github.com/dead-horse)<br/>|[<img src="https://avatars.githubusercontent.com/u/2039144?v=4" width="100px;"/><br/><sub><b>sang4lv</b></sub>](https://github.com/sang4lv)<br/>|[<img src="https://avatars.githubusercontent.com/u/2724034?v=4" width="100px;"/><br/><sub><b>missjing</b></sub>](https://github.com/missjing)<br/>|[<img src="https://avatars.githubusercontent.com/u/9857273?v=4" width="100px;"/><br/><sub><b>ShadyZOZ</b></sub>](https://github.com/ShadyZOZ)<br/>|[<img src="https://avatars.githubusercontent.com/u/15117664?v=4" width="100px;"/><br/><sub><b>zhaoxingyue</b></sub>](https://github.com/zhaoxingyue)<br/>|[<img src="https://avatars.githubusercontent.com/u/10082151?v=4" width="100px;"/><br/><sub><b>bowei-jbw</b></sub>](https://github.com/bowei-jbw)<br/>|
[<img src="https://avatars.githubusercontent.com/u/13050025?v=4" width="100px;"/><br/><sub><b>aladdin-add</b></sub>](https://github.com/aladdin-add)<br/>|[<img src="https://avatars.githubusercontent.com/u/143572?v=4" width="100px;"/><br/><sub><b>hotoo</b></sub>](https://github.com/hotoo)<br/>

This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Mon Mar 11 2019 15:51:28 GMT+0800`.
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Wed Nov 24 2021 15:28:00 GMT+0800`.

<!-- GITCONTRIBUTOR_END -->
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
environment:
matrix:
- nodejs_version: '8'
- nodejs_version: '10'
- nodejs_version: '12'
- nodejs_version: '14'
- nodejs_version: '16'

install:
- ps: Install-Product node $env:nodejs_version
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -3,14 +3,15 @@
const builtin = [
'./lib/legacy',
'./lib/rules/es6',
'./lib/rules/esnext',
'./lib/rules/es2020',
].map(require.resolve);

module.exports = {
extends: builtin.concat([
'plugin:eggache/recommended',
]),
parserOptions: {
ecmaVersion: 2020,
sourceType: 'script',
},
};
7 changes: 7 additions & 0 deletions lib/rules/es2020.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

module.exports = {
env: {
es2020: true,
},
};
7 changes: 0 additions & 7 deletions lib/rules/esnext.js

This file was deleted.

Loading