@whitetrefoil/eslint-config

4.0.1 • Public • Published

My Personal Default ESLint Rules Settings

Installation

Install below packages:

yarn add -D @dwzq/eslint-config \
            @eslint/js \
            eslint \
            eslint-plugin-eslint-comments \
            @stylistic/eslint-plugin-js

Install below package if needed:

yarn add -D @stylistic/eslint-plugin-jsx \
            @stylistic/eslint-plugin-plus \
            @stylistic/eslint-plugin-ts \
            eslint-plugin-n \
            eslint-plugin-react \
            eslint-plugin-react-hooks \
            eslint-plugin-solid \
            eslint-plugin-vue \
            typescript \
            typescript-eslint

Usage

This project now uses only "flat config". An "eslint.config.js" file in the project root directory is required.

Note: According to different "type" setting in package.json, the different file format (CommonJS / Module) will be required.

// Example eslint.config.js
import {generateConfig} from '@dwzq/eslint-config'


export default await generateConfig({
  type: 'node',
  ts  : {
    rootDir: import.meta.dirname,
  },
})

Check type declaration in source code for options.

See Also

  1. ESLint Rules
  2. ESLint Configuring
  3. ESLint Stylistic
  4. ESLint TS Plugin
  5. ESLint React Plugin
  6. ESLint node Plugin

Changelog

v4.0

v3.0

  • Use @stylistic/eslint-plugin i.o. 4 separated plugins

v2.0.0

  • Upgrade ESLint to v9

v1.0.0

  • Upgrade to flat config

v0.31.0

  • Remove Jest env (use import instead of global);
  • Fix wrong scope;
  • Simplify code structure;

v0.30.0

  • update rules;

v0.29.0

  • remove dependencies check totally;
  • allow !! for no-implicit-coercion rule;
  • disable newline-per-chained-call rule;

v0.28.1

  • disable eslint-dependencies for node proj;
  • un-ban {} for TS 4.8;

v0.28.0

  • disable default-case, enable @typescript-eslint/switch-exhaustiveness-check;

v0.27.0

  • Set peerDependencies optional;

v0.26.0

  • Upgrade rules;

v0.25.0

  • Totally refactored in order to simplify usage;

v0.24.1

  • Disable "prefer-object-has-own" for TS due to TS hasn't support it yet;

v0.24.0

  • Upgrade rules;
  • Revert changes about "tsconfig.json" in v0.13 since performance of ESLint has been improved;

v0.23.0

  • Move parserOption.project from rule presets to full presets;

v0.22.0

  • Upgrade rules (mainly ESLint v8);
  • Migrate to Yarn Berry;

v0.21.1

  • Consider peer & opt. dependencies when linting implicit dependencies.

v0.21.0

  • Upgrade rules;
  • Apply "implicit-dependencies" to only "src" dir;

v0.20.2

  • Disable "@typescript-eslint/space-infix-ops" until provides more detailed config;

v0.20.1

  • Relax "@typescript-eslint/consistent-type-assertions" for better "Opaque Type" expr;

v0.20.0

  • Fix missing scope of React rules;

v0.19.0

  • Include "eslint-plugin-implicit-dependencies";

v0.18.2

  • Disable "checksVoidReturn" of "@typescript-eslint/no-misused-promises";

v0.18.1

  • Regular update;

v0.18.0

  • Upgrade "ESLint" to 7.15;
  • Upgrade "typescript-eslint" to 4.10;
  • Upgrade TS, etc.;

v0.17.1

  • Fix deprecated "avoid-escape" option in "quotes" rules;

v0.17.0

  • Upgrade TS plugin to v4.8.0;
  • Turn off rules obsoleted in React 17;

v0.16.0

  • Upgrade TS plugin to v4.7.0;

v0.15.1

  • Allow constant condition in loop;

v0.15.0

  • Update rules (mainly eslint-typescript);

v0.14.1

  • Add impliedStrict: true to base preset.

v0.14.0

  • Use ESLint's "extends" instead of merge config obj programmatically, to solve some preset overriding bugs;
  • Disable "@typescript-eslint/consistent-type-definitions" because interfaces & type-aliases are just different stuff.
  • No longer force "ecmaVersion: 2020" for TS files since plugin team has fixed this.

v0.13.1

  • Use single additional "tsconfig.eslint.json" instead of "**/tsconfig.json" to resolve performance issue.
  • Disable "@typescript-eslint/no-invalid-void-type" for "typesafe-actions".
  • "typeParameter" allows both "UPPER_CASE" and "PascalCase".
  • Move required "env", "parserOptions", etc. into presets.
  • For TS presets, set "ecmaVersion" to 2020, see: typescript-eslint/typescript-eslint #2468.
  • Enable "no-magic-number".
  • Upgrade "typescript-eslint" to v4.1.0.
  • Upgrade ESLint to v7.9.0.

v0.8.2

  • Separate TS rules require type info out.

v0.7.2

  • Fix wrong parserOptions.project setting.

v0.7.1

  • Fix wrong parserOptions.project setting.

v0.7.0

  • 1st ver;

Readme

Keywords

Package Sidebar

Install

npm i @whitetrefoil/eslint-config

Weekly Downloads

68

Version

4.0.1

License

Unlicense

Unpacked Size

70.2 kB

Total Files

29

Last publish

Collaborators

  • whitetrefoil