Skip to content

Commit f7568a1

Browse files
Migrate to Prettier v3 (#732)
1 parent 7853c7b commit f7568a1

18 files changed

+403
-64
lines changed

.eslintrc.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,27 @@
2525
"react/jsx-props-no-spreading": "off",
2626
"react/require-default-props": "off",
2727
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
28-
"import/prefer-default-export":"off"
28+
"import/prefer-default-export": "off",
29+
// extend https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/imports.js
30+
"import/no-extraneous-dependencies": [
31+
"error",
32+
{
33+
"devDependencies": [
34+
"test/**", // tape, common npm pattern
35+
"tests/**", // also common npm pattern
36+
"spec/**", // mocha, rspec-like pattern
37+
"**/__tests__/**", // jest pattern
38+
"**/__mocks__/**", // jest pattern
39+
"test.{js,jsx,ts,tsx}", // repos with a single test file
40+
"test-*.{js,jsx,ts,tsx}", // repos with multiple top-level test files
41+
"**/*{.,_}{test,spec}.{js,jsx,ts,tsx}", // tests where the extension or filename suffix denotes that it is a test
42+
"**/jest.config.ts", // jest config
43+
"**/jest.setup.ts", // jest setup
44+
"**/prettier.config.ts",
45+
"**/vite.config.ts"
46+
],
47+
"optionalDependencies": false
48+
}
49+
]
2950
}
3051
}

.github/config/.licenserc.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ header:
2121
- '**/*.svg'
2222
- '**/*.properties'
2323

24-
2524
comment: on-failure

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
npm-debug.log*
66
/.idea
77
*.tgz
8+
.vscode/
9+
.idea/

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node-options=--experimental-strip-types

.prettierrc.json

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

.sonarlint/connectedMode.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"sonarCloudOrganization": "gridsuite",
33
"projectKey": "gridsuite_commons-ui"
4-
}
4+
}

README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,35 @@ The commons-ui library have a demo app in which you can call your components to
88
The `npm start` command install the library's dependencies then launches the demo app.
99

1010
If you want to test your library integration with a consumer application my-app you have first
11-
to build commons-ui via
11+
to build commons-ui via
12+
1213
- `npm install` (if not already done to get `tsc`)
1314
- `npm run build:pack`
1415

1516
Then in the my-app project :
16-
- Change the commons-ui dependency in my-app's package.json from
17-
`@gridsuite/commons-ui:"^x.x.x"`
18-
to
19-
`@gridsuite/commons-ui:"file:{PATH_TO_LIBRARY}/gridsuite-commons-ui-{LIBRARY_VERSION}.tgz"`
17+
18+
- Change the commons-ui dependency in my-app's package.json from
19+
`@gridsuite/commons-ui:"^x.x.x"`
20+
to
21+
`@gridsuite/commons-ui:"file:{PATH_TO_LIBRARY}/gridsuite-commons-ui-{LIBRARY_VERSION}.tgz"`
2022
- `npm install`
2123
- `npm start`
2224

23-
*Warning* : with Create React App, we realised the library was not updating correctly if you try to install the library multiple times.
25+
_Warning_ : with Create React App, we realised the library was not updating correctly if you try to install the library multiple times.
2426
To fix this, run this command from the app **after** running "npm install"
27+
2528
- rm -Rf node_modules/.cache
26-
2729

2830
#### For integrators
2931

3032
If you want to deploy a new version of commons-ui in the [NPM package registry](https://www.npmjs.com/package/@gridsuite/commons-ui),
3133
you need to follow the steps below:
3234

33-
- [Make a release action](https://github.com/gridsuite/commons-ui/actions/workflows/release.yml)
34-
- In the 'run workflow' combobox select, let the branch on main
35-
- Enter the type of evolution (major | minor | patch)
36-
- Enter your NPM access token (it must be an **automation** access token to bypass 2FA, see the [access token documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens) for details)
37-
- Click 'run workflow'
35+
- [Make a release action](https://github.com/gridsuite/commons-ui/actions/workflows/release.yml)
36+
- In the 'run workflow' combobox select, let the branch on main
37+
- Enter the type of evolution (major | minor | patch)
38+
- Enter your NPM access token (it must be an **automation** access token to bypass 2FA, see the [access token documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens) for details)
39+
- Click 'run workflow'
3840

3941
#### License Headers and dependencies checking
4042

@@ -44,6 +46,7 @@ To check dependencies license compatibility with this project one locally, pleas
4446
npm run licenses-check
4547
```
4648

47-
Notes :
48-
* Check [license-checker-config.json](license-checker-config.json) for license white list and exclusion.
49-
If you need to update this list, please inform organization's owners.
49+
Notes :
50+
51+
- Check [license-checker-config.json](license-checker-config.json) for license white list and exclusion.
52+
If you need to update this list, please inform organization's owners.

demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
-->
77

8-
<!DOCTYPE html>
8+
<!doctype html>
99
<html lang="en">
1010
<head>
1111
<meta charset="UTF-8" />

jest.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ const config: Config = {
1414
'^.+\\.(css|less|scss)$': 'identity-obj-proxy',
1515
},
1616
// see https://github.com/react-dnd/react-dnd/issues/3443
17-
transformIgnorePatterns: [
18-
'node_modules/(?!react-dnd|dnd-core|@react-dnd)',
19-
], // transform from ESM
17+
transformIgnorePatterns: ['node_modules/(?!react-dnd|dnd-core|@react-dnd)'], // transform from ESM
2018
globals: {
2119
IS_REACT_ACT_ENVIRONMENT: true,
2220
},

jest.setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
*/
77

8-
import '@testing-library/jest-dom'
8+
import '@testing-library/jest-dom';
99
import { TextEncoder, TextDecoder } from 'util';
1010

1111
// fix for ReferenceError: TextDecoder / TextEncoder is not defined

0 commit comments

Comments
 (0)