@roydukkey/eslint-config

4.0.0 • Public • Published

ESLint Config

Release Version License

Use this if you like, but I'll probably make changes and might not accept any.

Install

Install the packages:

pnpm add --save-dev \
@roydukkey/eslint-config \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser \
eslint

Vue

Install the optional peer dependency for linting Vue files.

pnpm add --save-dev eslint-plugin-vue

Configuration

Here is an example for configuring ESLint from the package.json and eslint.config.js.

{
  "script": {
    "lint": "eslint './**/*.@(?(m|c)@(j|t)s|@(j|t)sx|vue)'",
    "lint:fix": "npm run lint -- --fix"
  }
}
import { config } from 'typescript-eslint';
import roydukkeyConfig from '@roydukkey/eslint-config';

export default config(
  ...roydukkeyConfig({
    tsconfigRootDir: import.meta.dirname,
  }),
);

TypeScript

By default, this package will not use the tsconfig.json and instead only searches for tsconfig.eslint.json files. This provides better support for different monorepos.

Also, @typescript-eslint/recommended-requiring-type-checking is applied so don't forget to target the proper environments. For example, the following configuration targets Node:

import { config } from 'typescript-eslint';
import globals from 'globals';

export default config(
  {
    languageOptions: {
      globals: {
        ...globals.node,
      },
    },
  },
);

Readme

Keywords

Package Sidebar

Install

npm i @roydukkey/eslint-config

Weekly Downloads

45

Version

4.0.0

License

MIT

Unpacked Size

17.8 kB

Total Files

9

Last publish

Collaborators

  • roydukkey