-
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.
ci: replace yml configs with js fp-53 (#72)
* ci: replace yml lintstaged config with js fp-53 * ci: replace yml prettier config with js fp-53 * ci: replace yml eslint config with js fp-53
- Loading branch information
1 parent
c19f11b
commit a632ded
Showing
9 changed files
with
616 additions
and
367 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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,66 @@ | ||
import globals from 'globals'; | ||
// @ts-expect-error: no declaration file | ||
import js from '@eslint/js'; | ||
// @ts-expect-error: no declaration file | ||
import jsdoc from 'eslint-plugin-jsdoc'; | ||
|
||
/** @type {import('eslint').Linter.FlatConfig} */ | ||
const globalConfig = { | ||
languageOptions: { | ||
globals: globals.browser, | ||
parserOptions: { | ||
ecmaVersion: `latest`, | ||
sourceType: `module`, | ||
}, | ||
}, | ||
rules: { | ||
...js.configs.recommended.rules, | ||
}, | ||
}; | ||
|
||
/** @type {import('eslint').Linter.FlatConfig} */ | ||
const jsdocConfig = { | ||
plugins: { | ||
jsdoc, | ||
}, | ||
rules: { | ||
...jsdoc.configs[`recommended-typescript-flavor-error`].rules, | ||
'jsdoc/require-jsdoc': [ | ||
`error`, | ||
{ | ||
contexts: [ | ||
`ArrowFunctionExpression`, | ||
`FunctionDeclaration`, | ||
`FunctionExpression`, | ||
], | ||
}, | ||
], | ||
'jsdoc/require-param-description': [`off`], | ||
'jsdoc/require-returns-description': [`off`], | ||
'jsdoc/valid-types': [`off`], | ||
}, | ||
settings: { | ||
jsdoc: { | ||
mode: `typescript`, | ||
}, | ||
}, | ||
}; | ||
|
||
/** @type {import('eslint').Linter.FlatConfig} */ | ||
const mainRulesConfig = { | ||
rules: { | ||
'no-multiple-empty-lines': [ | ||
'error', | ||
{ | ||
max: 1, | ||
}, | ||
], | ||
curly: ['error', 'all'], | ||
'arrow-parens': ['error', 'always'], | ||
}, | ||
}; | ||
|
||
/** @type {import('eslint').Linter.FlatConfig[]} */ | ||
const config = [globalConfig, jsdocConfig, mainRulesConfig]; | ||
|
||
export default config; |
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,8 @@ | ||
/** @type {import('lint-staged').Config} */ | ||
const config = { | ||
'*': ['npm run lint:fs', 'npm run lint:editor'], | ||
'*.{json,md,yml,js}': 'prettier --write', | ||
'*.js': ['npm run lint:js', "bash -c 'npm run lint:type'"], | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.