0.14.0 • Published 6 days ago

@arianrhodsandlot/eslint-config v0.14.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 days ago

ESLint Config

npm

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:
    export { config as default } from '@arianrhodsandlot/eslint-config'
    or
    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

License

MIT

0.14.0

6 days ago

0.13.0

11 days ago

0.12.0

14 days ago

0.12.1

14 days ago

0.12.2

13 days ago

0.11.3

15 days ago

0.11.2

16 days ago

0.11.0

19 days ago

0.11.1

19 days ago

0.10.1

22 days ago

0.10.2

22 days ago

0.10.0

23 days ago

0.9.0

2 months ago

0.9.1

2 months ago

0.8.5

4 months ago

0.8.4

6 months ago

0.8.0-alpha.1

9 months ago

0.8.0-alpha.0

9 months ago

0.8.1

9 months ago

0.7.2

10 months ago

0.8.0

9 months ago

0.7.1

10 months ago

0.8.3

7 months ago

0.8.2

9 months ago

0.7.3

10 months ago

0.6.0-alpha.1

1 year ago

0.6.0-alpha.2

1 year ago

0.6.0-alpha.0

1 year ago

0.7.0-alpha.1

12 months ago

0.7.0-alpha.0

12 months ago

0.7.0

12 months ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.0-alpha.3

1 year ago

0.5.0-alpha.2

1 year ago

0.5.0-alpha.1

1 year ago

0.5.0-alpha.0

1 year ago

0.5.0

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.4.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.2-alpha.1

1 year ago

0.1.2-alpha.0

1 year ago

0.1.1-alpha.0

1 year ago

0.1.0

1 year ago