@viclafouch/eslint-config-viclafouch 3.9.3-beta.4 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,9 +12,10 @@ These are the ESLint and Prettier settings for a Next.js project ⚡️
|
|
|
12
12
|
- [Scripts](#scripts)
|
|
13
13
|
- [If you use TypeScript](#if-you-use-typescript)
|
|
14
14
|
- [Extend your tsconfig](#extend-your-tsconfig)
|
|
15
|
+
- [Add the typescript eslint config](#add-the-typescript-eslint-config)
|
|
15
16
|
- [Better typing](#better-typing)
|
|
16
17
|
- [Scripts](#scripts-1)
|
|
17
|
-
|
|
18
|
+
- [Better import sorting](#better-import-sorting)
|
|
18
19
|
- [If you use Next.js](#if-you-use-nextjs)
|
|
19
20
|
- [If you use React.js](#if-you-use-reactjs)
|
|
20
21
|
- [If you want to use Prettier](#if-you-want-to-use-prettier)
|
|
@@ -88,6 +89,8 @@ First, extend your current config file `tsconfig.json` with this following snipp
|
|
|
88
89
|
}
|
|
89
90
|
```
|
|
90
91
|
|
|
92
|
+
### Add the typescript eslint config
|
|
93
|
+
|
|
91
94
|
Then, add the TypeScript Eslint rules to your `.eslintrc` file:
|
|
92
95
|
|
|
93
96
|
```js
|
|
@@ -149,14 +152,17 @@ You can add two scripts to your package.json to lint and/or fix your code:
|
|
|
149
152
|
}
|
|
150
153
|
```
|
|
151
154
|
|
|
152
|
-
|
|
155
|
+
## Better import sorting
|
|
153
156
|
|
|
154
157
|
If you want to sort your imports using your alias at the same time from your `jsonfig.json` or `tsconfig.json` file.
|
|
155
158
|
|
|
156
159
|
1. Import the `sortImports` function from the config in your `.eslintrc.js` file:
|
|
157
160
|
|
|
158
161
|
```js
|
|
159
|
-
const {
|
|
162
|
+
const {
|
|
163
|
+
sortImports
|
|
164
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
165
|
+
} = require('@viclafouch/eslint-config-viclafouch/rules/sort-imports')
|
|
160
166
|
```
|
|
161
167
|
|
|
162
168
|
2. Include the function in your `overrides` array like this:
|