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

Remove unnecessary code #245

Merged
merged 2 commits into from
Jan 29, 2025
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
28 changes: 24 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ jobs:
- eslint: 9
node: 'lts/*'
os: macos-latest
# On old ESLint versions
- eslint: 8
node: 'lts/*'
os: ubuntu-latest

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -63,6 +59,30 @@ jobs:
run: npm run -s build
- name: Test
run: npm run -s test:mocha
test-for-old-eslint:
name: Test
strategy:
matrix:
eslint: [8]
node: ['lts/*']
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init
- name: Install Node.js v${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install Packages
run: npm install -f
- name: Install ESLint v${{ matrix.eslint }}
run: node scripts/ci-install-eslint ${{ matrix.eslint }}
- name: Test
run: npm run -s test:debug

test-cov:
name: Test and Send Coverage
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.19.0",
"@types/debug": "^4.1.7",
"@types/eslint": "^9.6.1",
"@types/estree": "^1.0.0",
"@types/lodash": "^4.14.186",
"@types/mocha": "^9.0.0",
Expand Down
17 changes: 0 additions & 17 deletions src/common/create-require.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/common/eslint-scope.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as escope from "eslint-scope"
import { lte } from "semver"
import { createRequire } from "./create-require"
import path from "path"
import { createRequire } from "module"

type ESLintScope = typeof escope & {
version: string
Expand Down
2 changes: 1 addition & 1 deletion src/common/espree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { ParserOptions } from "../common/parser-options"
// @ts-expect-error -- ignore
import * as dependencyEspree from "espree"
import { lte } from "semver"
import { createRequire } from "./create-require"
import path from "path"
import type { BasicParserObject } from "./parser-object"
import { createRequire } from "module"

type Espree = BasicParserObject & {
latestEcmaVersion: number
Expand Down
4 changes: 0 additions & 4 deletions test/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,6 @@ describe("Template AST", () => {
})

it("should scope in the correct.", () => {
const version = require(`eslint/package.json`).version
if (!semver.satisfies(version, ">=8")) {
return
}
const resultPath = path.join(ROOT, `${name}/scope.json`)
if (!fs.existsSync(resultPath)) {
return
Expand Down
Loading