Skip to content

Commit 60cafd9

Browse files
authored
Switch to flat config format (#609)
This PR is effectively a complete rewrite of the repo, from an ESLint plugin to a flat ESLint shared config. Previously, we were exporting a plugin because of a limitation of ESLint (eslint/eslint#3458), which has since been addressed by the flat config changes. In a nutshell, the old config style required you to list all your config's plugins as peer dependencies, and require your users to install them all. Since we have eight dependencies, that would have been a burden, so we created our own plugin that would re-export those plugins as if they were our own rules, shifting the burden to our team to maintain. Now, with the flat config, you can directly import dependencies, and everything just works, so we now have only a single peer dependency, ESLint itself. Much nicer. In a perfect world, there would be no breaking changes. I've worked hard to keep things as close to the previous version of the config as possible. In practice, I had to update some of the dependencies to opt into their flat configs, so there may be a handful of breaking changes from those dependencies.
1 parent 4708238 commit 60cafd9

File tree

92 files changed

+4440
-27811
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+4440
-27811
lines changed

.changeset/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.changeset/config.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

.changeset/sweet-mugs-shake.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.editorconfig

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
root = true
22

33
[*]
4-
indent_style = space
4+
indent_style = tab
55
indent_size = 2
66
charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = true
99

1010
[*.md]
11-
trim_trailing_whitespace = false
11+
trim_trailing_whitespace = false
12+
13+
# YAML files cannot have tabs
14+
# @see https://yaml.org/faq.html
15+
[*.yml]
16+
indent_style = space

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,17 @@ concurrency:
77
cancel-in-progress: true
88

99
jobs:
10-
lint:
10+
validate:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
14-
- name: Use Node.js 18
15-
uses: actions/setup-node@v3
13+
- name: Check out repository code
14+
uses: actions/checkout@v4
15+
- name: Setup Node
16+
uses: actions/setup-node@v4
1617
with:
17-
node-version: 18
18-
- name: Cache node modules
19-
uses: actions/cache@v3
20-
with:
21-
path: node_modules
22-
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
23-
restore-keys: |
24-
${{ runner.OS }}-build-${{ env.cache-name }}-
25-
${{ runner.OS }}-build-
26-
${{ runner.OS }}-
18+
node-version: 'lts/*'
19+
cache: 'npm'
2720
- name: Install Dependencies
28-
run: npm ci && npm link && npm link @cloudfour/eslint-plugin
29-
- name: Run Build
30-
run: npm run build
21+
run: npm ci
3122
- name: Run Lint
32-
run: npm run check-lint
23+
run: npm run lint:check

.github/workflows/release.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
node_modules
2-
/dist/*.js
3-
.vscode/
4-
/fixtures/repos
5-
/tmp-eslint-config
2+
.vscode

.npmrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/*

0 commit comments

Comments
 (0)