mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-23 11:38:48 +02:00
chore: fix CSS import order ESLint rule (#7852)
* enhance: added ESLint ruler for CSS import * chore: added ruler for default import of css, and fixed all exsting files * chore: reverted changes on css header rulers
This commit is contained in:
parent
9150c7aefc
commit
f6835898bc
7 changed files with 24 additions and 6 deletions
12
.eslintrc.js
vendored
12
.eslintrc.js
vendored
|
@ -249,6 +249,14 @@ module.exports = {
|
|||
'type',
|
||||
],
|
||||
pathGroups: [
|
||||
// always put css import to the last, ref:
|
||||
// https://github.com/import-js/eslint-plugin-import/issues/1239
|
||||
{
|
||||
pattern: '*.+(css|sass|less|scss|pcss|styl)',
|
||||
group: 'unknown',
|
||||
patternOptions: {matchBase: true},
|
||||
position: 'after',
|
||||
},
|
||||
{pattern: '@jest/globals', group: 'builtin', position: 'before'},
|
||||
{pattern: 'react', group: 'builtin', position: 'before'},
|
||||
{pattern: 'fs-extra', group: 'builtin'},
|
||||
|
@ -265,6 +273,10 @@ module.exports = {
|
|||
{pattern: '@theme-original/**', group: 'internal'},
|
||||
],
|
||||
pathGroupsExcludedImportTypes: [],
|
||||
// example: let `import './nprogress.css';` after importing others
|
||||
// in `packages/docusaurus-theme-classic/src/nprogress.ts`
|
||||
// see more: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md#warnonunassignedimports-truefalse
|
||||
warnOnUnassignedImports: true,
|
||||
},
|
||||
],
|
||||
'import/prefer-default-export': OFF,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue