Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support ESLint 7.x #7

Merged
merged 1 commit into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 59 additions & 49 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,74 @@ on:
pull_request:
branches: [master]
schedule:
- cron: 0 0 * * 0
- cron: 0 0 * * 0

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install Packages
run: npm install
- name: Lint
run: npm run -s lint
- name: Checkout
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install Packages
run: npm install
- name: Lint
run: npm run -s lint

test:
name: Test
strategy:
matrix:
node: [12, 10, 8, 6]
eslint: [6, 5]
exclude:
# ESLint 6 doesn't support Node 6.
- node: 6
eslint: 6
# Run ESLint 5 on only the newest and oldest Node.
- node: 10
eslint: 5
- node: 8
eslint: 5
runs-on: ubuntu-latest
os: [ubuntu-latest]
eslint: [7]
node: [14]
include:
# On other platforms
- eslint: 7
node: 14
os: windows-latest
- eslint: 7
node: 14
os: macos-latest
# On old Node.js versions
- eslint: 7
node: 12
os: ubuntu-latest
- eslint: 7
node: 10
os: ubuntu-latest
# On old ESLint versions
- eslint: 6
node: 14
os: ubuntu-latest
- eslint: 5
node: 14
os: ubuntu-latest
# On the minimum supported ESLint/Node.js version
- eslint: 5
node: 10
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install Node.js v${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install Packages
run: |
if [ ${{ matrix.node }} -eq 6 ]; then
npm install --global npm@^6.0.0
fi
npm install
- name: Install ESLint v${{ matrix.eslint }}
run: npm install --no-save eslint@^${{ matrix.eslint }}.0.0
- name: Build
run: npm run -s build
- name: Test
run: npm run -s test:mocha
- name: Send Coverage
run: npm run -s codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
- name: Install Node.js v${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install Packages
run: npm install
- name: Install ESLint ${{ matrix.eslint }}
run: npm install --no-save eslint@${{ matrix.eslint }}
- name: Build
run: npm run -s build
- name: Test
run: npm run -s test:mocha
- name: Send Coverage
run: npm run -s codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm install eslint-utils
```

::: tip Requirements
`eslint-utils` requires Node.js `6.5.0` or newer versions.
`eslint-utils` requires Node.js `10` or newer versions.
:::

## 📖 Usage
Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.1.0",
"description": "Utilities for ESLint plugins.",
"engines": {
"node": ">=6"
"node": ">=10"
},
"sideEffects": false,
"main": "index",
Expand All @@ -12,15 +12,15 @@
"index.*"
],
"dependencies": {
"eslint-visitor-keys": "^1.1.0"
"eslint-visitor-keys": "^2.0.0"
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
},
"devDependencies": {
"@mysticatea/eslint-plugin": "^12.0.0",
"@mysticatea/eslint-plugin": "^13.0.0",
"codecov": "^3.6.1",
"dot-prop": "^4.2.0",
"eslint": "^6.5.1",
"eslint": "^7.24.0",
"esm": "^3.2.25",
"espree": "^6.1.1",
"espree": "^7.3.1",
"mocha": "^6.2.2",
"npm-run-all": "^4.1.5",
"nyc": "^14.1.1",
Expand All @@ -32,6 +32,9 @@
"vuepress": "^1.2.0",
"warun": "^1.0.0"
},
"peerDependencies": {
"eslint": ">=5"
},
"scripts": {
"prebuild": "npm run -s clean",
"build": "rollup -c",
Expand Down
2 changes: 1 addition & 1 deletion test/pattern-matcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PatternMatcher } from "../src/"

const NAMED_CAPTURE_GROUP_SUPPORTED = (() => {
try {
new RegExp("(?<a>)", "u") //eslint-disable-line no-new, prefer-regex-literals, @mysticatea/node/no-unsupported-features/es-syntax
new RegExp("(?<a>)", "u") //eslint-disable-line no-new, prefer-regex-literals
return true
} catch (_error) {
return false
Expand Down