Skip to content

Commit d9a116f

Browse files
committed
Update readme about require
1 parent a7dbeb8 commit d9a116f

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

README.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,7 @@ It is recommended to also set up [Prettier], to help formatting your imports (an
140140
"import/first": "error",
141141
"import/newline-after-import": "error",
142142
"import/no-duplicates": "error"
143-
},
144-
"overrides": [
145-
{
146-
"files": "server/**/*.js",
147-
"env": { "node": true },
148-
"rules": {
149-
"simple-import-sort/imports": "off",
150-
"import/order": ["error", { "newlines-between": "always" }]
151-
}
152-
}
153-
]
143+
}
154144
}
155145
```
156146

@@ -159,9 +149,6 @@ It is recommended to also set up [Prettier], to help formatting your imports (an
159149
- [import/first] makes sure all imports are at the top of the file. (autofixable)
160150
- [import/newline-after-import] makes sure there’s a newline after the imports. (autofixable)
161151
- [import/no-duplicates] merges import statements of the same file. (autofixable, mostly)
162-
- For Node.js code, `simple-import-sort/imports` is turned off and replaced with [import/order] for sorting of `require` calls.
163-
164-
With the above configuration, you don’t need to scroll to the top of the file to add another import. Just put it above your function! ESLint will then snap it into place (at the top of the file, in order, and without duplicates).
165152

166153
## Not for everyone
167154

@@ -532,7 +519,7 @@ The final whitespace rule is that this plugin puts one import/export per line. I
532519

533520
### Does it support `require`?
534521

535-
No. This is intentional to keep things simple. Use some other sorting rule, such as [import/order], for sorting `require`.
522+
No. This is intentional to keep things simple. Use some other sorting rule, such as [import/order], for sorting `require`. Or consider migrating your code using `require` to `import`. `import` is well supported these days.
536523

537524
### Why sort on `from`?
538525

0 commit comments

Comments
 (0)