@arianrhodsandlot/eslint-config v0.14.0
ESLint Config
A set of predefined ESLint config.
Usage
To use this package, ESLint should be configured by an file named eslint.config.js
, since we are using ESLint's flat config.
- Basic usage:
orexport { config as default } from '@arianrhodsandlot/eslint-config'
export { default } from '@arianrhodsandlot/eslint-config'
- For CommonJS environment:
module.exports = require('@arianrhodsandlot/eslint-config').config
Advanced usage:
Use the more powerful function
createConfig
+createConfig
is a smart function that can detect should TS rules be enabled or which libraries-related plugins/rules should be + added:```js import { createConfig } from '@arianrhodsandlot/eslint-config' export default createConfig() ``` + Since flat config is actually an array, we can append more config items to it: ```js import { createConfig } from '@arianrhodsandlot/eslint-config' export default createConfig({ append: { files: ['**/*.html'], plugins: { html: eslintHtmlPlugin, }, rules: eslintHtmlPlugin.configs.recommended.rules, }, prepend: { ignore: ['build/**/*'] }, }) ``` + Additional plugins/rules can be explictly enabled or disabled: ```js import { createConfig } from '@arianrhodsandlot/eslint-config' export default createConfig({ markdown: false, next: true, prettier: false, react: true, rules: { eqeqeq: 'off', }, }) ``` The full list of options are listed below. ```ts export interface CreateConfigOptions { /** Append custom flat configs to default */ append?: FlatConfig | FlatConfigs /** Should eslint-plugin-compat be enabled */ compat?: boolean /** Should eslint-plugin-diff be enabled */ diff?: boolean /** Should eslint-plugin-eslint-comments be enabled */ eslintComments?: boolean /** Should eslint-plugin-import be enabled */ import?: boolean /** Should eslint-plugin-jsdoc be enabled */ jsdoc?: boolean /** Should eslint-plugin-markdown be enabled */ markdown?: boolean /** Should eslint-plugin-n be enabled */ n?: boolean /** Should \@next/eslint-plugin-next be enabled */ next?: boolean /** Should eslint-plugin-perfectionist be enabled */ perfectionist?: boolean /** Append custom flat configs to default */ prepend?: FlatConfig | FlatConfigs /** Should eslint-plugin-prettier be enabled */ prettier?: boolean /** Should eslint-plugin-promise be enabled */ promise?: boolean /** Should eslint-plugin-react, eslint-plugin-jsx-a11y, eslint-plugin-react-hooks, eslint-plugin-react-refresh be enabled */ react?: boolean /** Should eslint-plugin-regexp be enabled */ regexp?: boolean /** Custom rules */ rules?: FlatConfigRules /** Should eslint-plugin-security be enabled */ security?: boolean /** Should eslint-plugin-sonarjs be enabled */ sonarjs?: boolean /** Should eslint-plugin-tsdoc be enabled */ tsdoc?: boolean /** Should \@typescript-eslint/eslint-plugin be enabled */ typescript?: boolean /** Should eslint-plugin-unicorn be enabled */ unicorn?: boolean /** Should eslint-plugin-vue, eslint-plugin-vuejs-accessibility, eslint-plugin-vue-scoped-css be enabled */ vue?: boolean } ```
Features
- Integrated with following ESLint plugins and configurations recommended by them:
- For best practices:
- For Styling:
- Languages related:
- Libraries and frameworks related:
- Others:
- eslint-plugin-diff (disabled by default)
- Libraries and frameworks related plugins are loaded ondemand.
- Made for ESLint's flat config.
License
6 days ago
11 days ago
14 days ago
14 days ago
13 days ago
15 days ago
16 days ago
19 days ago
19 days ago
22 days ago
22 days ago
23 days ago
2 months ago
2 months ago
4 months ago
6 months ago
9 months ago
9 months ago
9 months ago
10 months ago
9 months ago
10 months ago
7 months ago
9 months ago
10 months ago
1 year ago
1 year ago
1 year ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago