Skip to content

Commit 5d0a617

Browse files
committed
build: migrate prettier config to typescript and remove eslint-plugin-prettier
This change moves from using `eslint-prettier-plugin` to using `eslint-config-prettier` and prettier directly for format checking. A result of us never running prettier on the root files, is that there were some adjustments needed. I ran prettier on the repo and have added those changes too. Lastly, I moved the config to `typescript`.
1 parent 2ce1383 commit 5d0a617

File tree

8 files changed

+95
-123
lines changed

8 files changed

+95
-123
lines changed

.github/renovate.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": ["github>eslint/eslint//.github/renovate.json5"]
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["github>eslint/eslint//.github/renovate.json5"]
44
}

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
node-version: 'lts/*'
3535
- run: npm install
3636
- run: npm run lint
37+
- run: npm run format:check
3738

3839
test-remote:
3940
name: eslint-remote-tester

.markdownlint.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"line-length": false,
3-
"no-inline-html": false
3+
"no-inline-html": false,
4+
"no-duplicate-heading": {
5+
"siblings_only": true
6+
}
47
}

CHANGELOG.md

Lines changed: 73 additions & 112 deletions
Large diffs are not rendered by default.

LICENSE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
The MIT License (MIT)
2-
=====================
1+
# The MIT License (MIT)
32

43
Copyright © 2016 Teddy Katz
54

eslint.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ import path from 'node:path';
22
import { fileURLToPath } from 'node:url';
33
import js from '@eslint/js';
44
import { FlatCompat } from '@eslint/eslintrc';
5+
import prettier from 'eslint-config-prettier/flat';
56
import markdown from 'eslint-plugin-markdown';
67
import pluginN from 'eslint-plugin-n';
78
import tseslint from 'typescript-eslint';
9+
import unicorn from 'eslint-plugin-unicorn';
10+
811
import eslintPlugin from './lib/index.js';
912

1013
const dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -25,9 +28,8 @@ export default tseslint.config([
2528
...compat.extends(
2629
'not-an-aardvark/node',
2730
'plugin:@eslint-community/eslint-comments/recommended',
28-
'plugin:prettier/recommended',
29-
'plugin:unicorn/recommended',
3031
),
32+
unicorn.configs.recommended,
3133
pluginN.configs['flat/recommended'],
3234
{
3335
rules: {
@@ -91,4 +93,5 @@ export default tseslint.config([
9193
'unicorn/filename-case': 'off',
9294
},
9395
},
96+
prettier,
9497
]);

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"license": "MIT",
1313
"scripts": {
1414
"build": "tsup",
15+
"format": "prettier --write .",
16+
"format:check": "prettier --check .",
1517
"lint": "npm-run-all --continue-on-error --aggregate-output --parallel lint:*",
1618
"lint:docs": "markdownlint \"**/*.md\"",
1719
"lint:eslint-docs": "npm-run-all -s build \"update:eslint-docs -- --check\"",
@@ -69,8 +71,7 @@
6971
"eslint-doc-generator": "^2.2.2",
7072
"eslint-plugin-markdown": "^5.1.0",
7173
"eslint-plugin-n": "^17.21.0",
72-
"eslint-plugin-prettier": "^5.5.3",
73-
"eslint-plugin-unicorn": "^56.0.1",
74+
"eslint-plugin-unicorn": "^60.0.0",
7475
"eslint-remote-tester": "^4.0.3",
7576
"eslint-scope": "^8.0.1",
7677
"espree": "^10.0.1",
@@ -80,7 +81,7 @@
8081
"markdownlint-cli": "^0.43.0",
8182
"npm-package-json-lint": "^8.0.0",
8283
"npm-run-all2": "^7.0.1",
83-
"prettier": "^3.4.1",
84+
"prettier": "^3.6.2",
8485
"release-it": "^17.2.0",
8586
"tsup": "^8.5.0",
8687
"typescript": "^5.9.2",

prettier.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
export default {
1+
import { type Config } from 'prettier';
2+
3+
const config: Config = {
24
singleQuote: true,
35
};
6+
7+
export default config;

0 commit comments

Comments
 (0)