Skip to content

Commit 39972a6

Browse files
Fix Prettier to work with IDE plugins (#96)
1 parent 22fcc6b commit 39972a6

File tree

6 files changed

+16
-9
lines changed

6 files changed

+16
-9
lines changed

.eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"extends": ["react-app", "plugin:prettier/recommended"],
44
"ignorePatterns": [
55
// node_modules is implicitly always ignored
6-
"build"
6+
"build",
7+
"coverage"
78
],
89
"settings": {
910
"import/parsers": {

.npmrc

-1
This file was deleted.

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/gridsuite/gridadmin-app"
1111
},
1212
"engines": {
13-
"node": ">=22.6.0",
13+
"node": ">=22",
1414
"npm": "^10.9.2"
1515
},
1616
"dependencies": {

prettier.config.ts renamed to prettier.config.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
*/
77

8-
import type { Config } from 'prettier';
9-
10-
export default {
8+
// @ts-check
9+
/**
10+
* @see https://prettier.io/docs/configuration
11+
* @type {import("prettier").Config}
12+
* @todo Pass this file in typescript when the IDEs plugins support it<ul>
13+
* <li>https://github.com/prettier/prettier-vscode/issues/3623</li>
14+
* <li>https://youtrack.jetbrains.com/issue/WEB-71713/Support-for-prettier.config.ts</li></ul>
15+
*/
16+
const config = {
1117
trailingComma: 'es5',
1218
tabWidth: 4,
1319
printWidth: 120,
@@ -24,4 +30,5 @@ export default {
2430
options: { tabWidth: 2 },
2531
},
2632
],
27-
} satisfies Config;
33+
};
34+
export default config;

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"jest.setup.ts",
2323
// We must list config files in typescript because needed by prettier when called by eslint as plugin
2424
"jest.config.ts",
25-
"prettier.config.ts",
25+
"prettier.config.js",
2626
"vite.config.ts"
2727
]
2828
}

0 commit comments

Comments
 (0)