Skip to content

Commit

Permalink
Remove unnecessary code (#245)
Browse files Browse the repository at this point in the history
* Remove unnecessary code

* fix ci
  • Loading branch information
ota-meshi authored Jan 29, 2025
1 parent 7e30c9f commit 769da24
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 183 deletions.
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

0 comments on commit 769da24

Please sign in to comment.