1.4.0 • Published 7 months ago

@wolves-league/eslint-config v1.4.0

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

🐺 Wolves League ESLint config

Setup

Install the package, ESLint and Prettier as dev dependencies:

NPM
npm i -D @wolves-league/eslint-config eslint prettier
PNPM
pnpm add -D @wolves-league/eslint-config eslint prettier
Bun
bun add -D @wolves-league/eslint-config eslint prettier

If you use VSCode

In settings.json add the following configuration:

"eslint.useFlatConfig": true,

Node.js/Bun

eslint.config.mjs

import wlConfig from '@wolves-league/eslint-config';

/** @type {Array<import('eslint').Linter.Config>} */
export default wlConfig.configs.node;

React

eslint.config.mjs

import wlConfig from '@wolves-league/eslint-config';

/** @type {Array<import('eslint').Linter.Config>} */
export default wlConfig.configs.react;

Extend the configuration

If you want to extend or override the configuration you can just spread the config inside an array, and add configuration objects:

eslint.config.mjs

import wlConfig from '@wolves-league/eslint-config';

/** @type {Array<import('eslint').Linter.Config>} */
export default [
  ...wlConfig.configs.node,
  {
    rules: {
      semi: 'error',
    },
  },
];

Refer to ESLint official documentation for more information.

CommonJS

If you need to use CommonJS, you can use the following configuration:

eslint.config.cjs

const wlConfig = require('@wolves-league/eslint-config');

/** @type {Array<import('eslint').Linter.Config>} */
module.exports = wlConfig.configs.react; // react | node

Prettier Configuration

To use Prettier, simply create a prettier.config.mjs file in the root of your project and export the config:

import wlConfig from '@wolves-league/eslint-config';

/** @type {import('prettier').Config} */
export default wlConfig.configs.prettier;

Override or Extend Prettier Configuration

If you need to override or extend the Prettier configuration, spread the config object and add any rule you want. Alternatively, you can ignore the config and use your own.

The following code is an example of extending the Prettier configuration with prettier-plugin-tailwindcss:

prettier.config.mjs

import wlConfig from '@wolves-league/eslint-config';

/** @type {import('prettier').Config} */
export default {
  ...wlConfig.configs.prettier, // Omit this line to use the default Prettier configuration and/or use your own
  plugins: ['prettier-plugin-tailwindcss'],
  // Add your custom rules and settings here
};
1.4.0

7 months ago

1.3.4

7 months ago

1.3.3

8 months ago

1.3.2

8 months ago

1.3.1

8 months ago

1.3.0

8 months ago

1.2.1

8 months ago

1.2.0

9 months ago

1.1.6

9 months ago

1.1.5

10 months ago

1.1.4

10 months ago

1.1.3

12 months ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago