Skip to content

Commit

Permalink
chore: Use eslint v9 and flat config (#738)
Browse files Browse the repository at this point in the history
This PR changes to use ESLint v9.
  • Loading branch information
ota-meshi committed Apr 19, 2024
1 parent 903bd40 commit 1ce5774
Show file tree
Hide file tree
Showing 49 changed files with 407 additions and 634 deletions.
39 changes: 0 additions & 39 deletions .eslintignore

This file was deleted.

192 changes: 0 additions & 192 deletions .eslintrc.js

This file was deleted.

26 changes: 17 additions & 9 deletions .github/workflows/NodeCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
eslint: [7, 8]
eslint: [7, 8, 9]
node: [20]
include:
# On next ESLint version
- eslint: ^9.0.0-0
node: 20
os: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -58,7 +53,7 @@ jobs:
run: |+
pnpm install -D eslint@${{ matrix.eslint }}
rm -rf node_modules
if: matrix.eslint != 8
if: matrix.eslint != 9
- name: Install Packages
run: pnpm install
- name: Test
Expand All @@ -69,7 +64,16 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [16, 17, 18, 20]
eslint: [9]
node: [18, 20]
include:
# On old Node.js version
- eslint: 8
node: 16
os: ubuntu-latest
- eslint: 8
node: 17
os: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -82,6 +86,10 @@ jobs:
run: |+
pnpm install -D svelte@4
rm -rf node_modules
- name: Install ESLint ${{ matrix.eslint }}
run: |+
pnpm install -D eslint@${{ matrix.eslint }}
rm -rf node_modules
- name: Install Packages
run: pnpm install
- name: Test
Expand All @@ -107,7 +115,7 @@ jobs:
rm -rf node_modules
- name: Install svelte@3
run: |+
pnpm install -D svelte@3 @typescript-eslint/parser@5 @typescript-eslint/eslint-plugin@5
pnpm install -D svelte@3 @typescript-eslint/parser@5 @typescript-eslint/eslint-plugin@5 eslint@8
rm -rf node_modules
- name: Install Packages
run: pnpm install
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Use `eslint.config.js` file to configure rules. See also: <https://eslint.org/do

Example **eslint.config.js**:

```mjs
```js
import eslintPluginSvelte from 'eslint-plugin-svelte';
export default [
// add more generic rule sets here, such as:
Expand Down
15 changes: 0 additions & 15 deletions docs-svelte-kit/.eslintrc.cjs

This file was deleted.

13 changes: 1 addition & 12 deletions docs-svelte-kit/build-system/build.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,9 @@ import esbuild from 'esbuild';
import path from 'path';
import fs from 'fs';
import { fileURLToPath } from 'url';
// const babelCore = require("@babel/core")
// const t = require("@babel/types")

const dirname = path.dirname(
fileURLToPath(
// @ts-expect-error -- Cannot change `module` option
import.meta.url
)
);
const dirname = path.dirname(fileURLToPath(import.meta.url));

build(path.join(dirname, './src/eslint.mjs'), path.join(dirname, '../shim/eslint.mjs'), [
'assert',
'util'
]);
build(path.join(dirname, '../../node_modules/assert'), path.join(dirname, '../shim/assert.mjs'));

/** build */
Expand Down
6 changes: 0 additions & 6 deletions docs-svelte-kit/build-system/src/eslint.mjs

This file was deleted.

1 change: 0 additions & 1 deletion docs-svelte-kit/shim/fs.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint require-jsdoc:0 -- shim */
function existsSync() {
return false;
}
Expand Down
2 changes: 0 additions & 2 deletions docs-svelte-kit/shim/globby.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
/* eslint require-jsdoc:0 -- shim */

export {};
export default {};
1 change: 0 additions & 1 deletion docs-svelte-kit/shim/module.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint require-jsdoc:0 -- shim */
function _createRequire() {
return () => null;
}
Expand Down
1 change: 0 additions & 1 deletion docs-svelte-kit/shim/os.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint require-jsdoc:0 -- shim */
function platform() {
return '';
}
Expand Down

0 comments on commit 1ce5774

Please sign in to comment.