Skip to content

Commit 94b6656

Browse files
feat(flat-config)!: migrate to flat config and update rules (#2)
1 parent 83f9a17 commit 94b6656

File tree

10 files changed

+2508
-587
lines changed

10 files changed

+2508
-587
lines changed

.eslintrc.js

Lines changed: 0 additions & 116 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
name: release-please
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: google-github-actions/release-please-action@v4
17+
with:
18+
token: ${{ secrets.RELEASE_PLEASE_PAT_OLIVER }}
19+
config-file: release-please-config.json
20+

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"trailingComma": "all",
3+
"singleQuote": false,
4+
"printWidth": 100,
5+
"semi": true,
6+
"arrowParens": "always",
7+
"bracketSpacing": true,
8+
"bracketSameLine": false,
9+
"useTabs": false,
10+
"tabWidth": 2
11+
}

README.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# eslint-config-squonk
2+
23
ESLint config used by Squonk front-end apps
34

45
## Installation
@@ -11,29 +12,16 @@ This assumes you are using `pnpm`.
1112
pnpm add -D eslint @squonk/eslint-config
1213
```
1314

14-
2. Create (or modify) a `.eslintrc.js` (or `.eslintrc.cjs` if your `package.json` is to `"type": "module"`) file with the following:
15+
2. Create (or modify) a `eslint.config.js` for your _flat_ eslint config file and merge the configs you need for the project:
1516

1617
```js
17-
/**
18-
* @type {import("eslint").Linter.Config}
19-
*/
20-
module.exports = {
21-
parserOptions: {
22-
project: "tsconfig.json",
23-
tsconfigRootDir: __dirname,
24-
},
25-
extends: ["@squonk/eslint-config"],
26-
};
27-
```
18+
import config from "@squonk/eslint-config";
2819

29-
3. You will need to ensure your `tsconfig.json` `includes` the all files you wish to be linted to prevent errors. Ensure it has the following entry to format dotfiles too:
30-
31-
```json
32-
"include": [
33-
...,
34-
]
20+
export default config.map((c) => ({ ...c, ignores: ["**/dist/**"] }));
3521
```
3622

23+
Add any files and directories you wish to ignore since .eslintignore is removed for flat configs.
24+
3725
4. Install peer dependencies or (preferred) set `--resolve--resolve-plugins-relative-to="path/to/@squonk/eslint-config"` (may be a monorepo or the node-modules folder)
3826

3927
## Development

0 commit comments

Comments
 (0)