-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(eslint-config): wrap remaining configs with `requireOf (#808)
- Loading branch information
1 parent
5bc17fd
commit bccde3a
Showing
9 changed files
with
530 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@bfra.me/eslint-config": patch | ||
--- | ||
|
||
Wrap remaining configs with `requireOf`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
import type {Config} from '../config' | ||
import config from 'eslint-plugin-command/config' | ||
import {interopDefault} from '../plugins' | ||
import {requireOf} from '../require-of' | ||
import {fallback} from './fallback' | ||
|
||
export async function command(): Promise<Config[]> { | ||
return [ | ||
{ | ||
...config(), | ||
name: '@bfra.me/command', | ||
return requireOf( | ||
['eslint-plugin-command'], | ||
async () => { | ||
const config = await interopDefault(import('eslint-plugin-command/config')) | ||
return [ | ||
{ | ||
...config(), | ||
name: '@bfra.me/command', | ||
}, | ||
] | ||
}, | ||
] | ||
fallback, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,31 @@ | ||
import type {Config} from '../config' | ||
import {importX as pluginImportX} from '../plugins' | ||
import {interopDefault} from '../plugins' | ||
import {requireOf} from '../require-of' | ||
import {fallback} from './fallback' | ||
|
||
export async function imports(): Promise<Config[]> { | ||
return [ | ||
{ | ||
name: '@bfra.me/imports', | ||
plugins: { | ||
'import-x': pluginImportX as any, | ||
}, | ||
rules: { | ||
'import-x/no-named-default': 'error', | ||
'import-x/first': 'error', | ||
'import-x/no-duplicates': 'error', | ||
'import-x/no-mutable-exports': 'error', | ||
'import-x/no-self-import': 'error', | ||
'import-x/no-useless-path-segments': 'error', | ||
'import-x/no-webpack-loader-syntax': 'error', | ||
}, | ||
return requireOf( | ||
['eslint-plugin-import-x'], | ||
async () => { | ||
const pluginImportX = await interopDefault(import('eslint-plugin-import-x')) | ||
return [ | ||
{ | ||
name: '@bfra.me/imports', | ||
plugins: { | ||
'import-x': pluginImportX as any, | ||
}, | ||
rules: { | ||
'import-x/no-named-default': 'error', | ||
'import-x/first': 'error', | ||
'import-x/no-duplicates': 'error', | ||
'import-x/no-mutable-exports': 'error', | ||
'import-x/no-self-import': 'error', | ||
'import-x/no-useless-path-segments': 'error', | ||
'import-x/no-webpack-loader-syntax': 'error', | ||
}, | ||
}, | ||
] | ||
}, | ||
] | ||
fallback, | ||
) | ||
} |
Oops, something went wrong.