13.3.1 • Published 3 months ago

@hazmi35/eslint-config v13.3.1

Weekly downloads
1,456
License
MIT
Repository
github
Last release
3 months ago

eslint-config

An opinionated, but sane ESLint shareable config that I used in my projects ✔

Install

npm install -D @hazmi35/eslint-config # npm
pnpm add -D @hazmi35/eslint-config # pnpm
yarn add -D @hazmi35/eslint-config # yarn

This package has the required dependency installed automatically by peer dependencies by default on npm v7+, pnpm, or yarn. Install them manually if not.

Usage

This package requires ESLint Flat Configuration.

Available configurations:

Configuration

Create an eslint.config.js file in the root of your project and add the following code:

import { common, modules, node, stylistic, ignores } from "@hazmi35/eslint-config";

export default [...common, ...modules, ...node, ...stylistic, ...ignores];
module.exports = (async () => {
    const { common, node, stylistic, ignores } = await import("@hazmi35/eslint-config");

    return [...common, ...node, ...stylistic, ...ignores];
})();
import { common, modules, node, stylistic, typescript, ignores } from "@hazmi35/eslint-config";

export default [...common, ...modules, ...node, ...stylistic, ...typescript, ...ignores];
import { common, modules, node, prettier, ignores } from "@hazmi35/eslint-config";

// Prettier must not be used with stylistic config, because it will conflict with each other.
export default [...common, ...modules, ...node, ...prettier, ...ignores];

Extending rules using the extend function is recommended.

import { common, extend, modules, node, stylistic, typescript, ignores } from "./index.js";

export default [...common, ...modules, ...node, ...stylistic, ...ignores, ...extend(typescript, [
    {
        rule: "@typescript-eslint/no-unnecessary-condition",
        option: [
            "warn",
            {
                allowConstantLoopConditions: false
            }
        ]
        // or
        option: ["off"]
    }
])];

Usage with Code Editors

VSCode

As of right now, the VSCode ESLint extension need to enable flat config support manually. To do that, open your VSCode settings and add the following code:

{
    "eslint.experimental.useFlatConfig": true
}

This is a known issue and will be fixed in the future, see: microsoft/vscode-eslint#1644

13.3.1

3 months ago

13.3.0

3 months ago

13.2.4

4 months ago

13.2.2

4 months ago

13.2.3

4 months ago

13.1.0

4 months ago

13.0.6

4 months ago

13.0.4

4 months ago

13.0.5

4 months ago

13.2.0

4 months ago

13.2.1

4 months ago

13.0.3

4 months ago

13.0.2

4 months ago

13.0.0

4 months ago

13.0.1

4 months ago

12.0.0

4 months ago

11.0.0

9 months ago

10.0.0

11 months ago

9.0.0

1 year ago

8.7.1

1 year ago

8.7.0

1 year ago

8.6.0

1 year ago

8.5.0

2 years ago

8.5.1

2 years ago

8.4.2

2 years ago

8.4.1

2 years ago

8.4.0

2 years ago

8.3.0

2 years ago

8.2.1

2 years ago

8.2.0

2 years ago

8.1.0

2 years ago

8.0.0

2 years ago

8.1.1

2 years ago

7.0.0

3 years ago

7.0.1

3 years ago

6.0.1

3 years ago

6.0.0

3 years ago

6.0.2

3 years ago

5.0.0

3 years ago

4.1.0

3 years ago

4.1.1

3 years ago

4.0.0

3 years ago

3.6.0

3 years ago

3.5.0

3 years ago

3.4.0

3 years ago

3.3.0

3 years ago

3.2.1

3 years ago

3.2.0

4 years ago

3.0.0

4 years ago

2.1.2

4 years ago

2.1.3

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.2.0

4 years ago

1.1.2

4 years ago

1.0.0

4 years ago

0.9.6

4 years ago

0.9.5

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago