0.12.0 • Published 10 months ago

@woohm402/eslint-config-base v0.12.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

NPM Version

@woohm402/eslint-config-base

ESLint configuration for TypeScript projects

Usage

Installation

Install the package:

npm install --save-dev @woohm402/eslint-config-base

Add the following to your eslint.config.js file:

import woohm402EslintConfigBase from '@woohm402/eslint-config-base';

export default [
  ...woohm402EslintConfigBase({
    envAllowedFiles: ['src/main.ts'],
    tsconfigRootDir: import.meta.dirname,
  }),
];

Parameters

  • envAllowedFiles (optional)
    • An array of file paths that are allowed to use environment variables directly.
    • If you have a file that uses process.env or import.meta.env, list them all.
  • tsconfigRootDir (required)
    • The root directory of the TypeScript project.

Rules

This configuration extends the following recommended configurations:

  • eslint
  • typescript-eslint

It also includes the following additional rules:

  • 'simple-import-sort/imports': 'error'
    • This rule enforces a consistent order for import statements.
  • '@eslint-community/eslint-comments/no-use': ['error', { allow: [] }]
    • This rule disallows the use of eslint comments e.g. // eslint-disable-next-line.
    • If you want to disable a rule, you should do so in the configuration file.
  • 'no-restricted-syntax': ['error', ...] about console.log
    • This rule disallows usage of console.log.
    • Usually console.log is used for debugging purposes and should be removed before committing code.
    • If you intended to print to the console, use alternative methods like console.debug or console.error.
  • 'no-restricted-syntax': ['error', ...] about env
    • This rule disallows usage of process.env in too many places.
    • Env variables are hard to track and should be used sparingly.
    • You might need to use env variable, so pass envAllowedFiles option to this rule. They will be ignored.
  • '@typescript-eslint/no-shadow'
  • '@typescript-eslint/restrict-template-expressions'
  • '@typescript-eslint/strict-boolean-expressions'
0.12.0

10 months ago

0.11.0

10 months ago

0.10.0

11 months ago

0.9.0

11 months ago

0.8.0

12 months ago

0.7.2

1 year ago

0.7.1

1 year ago

0.7.4

1 year ago

0.7.3

1 year ago

0.7.0

1 year ago

0.6.0

1 year ago

0.5.0

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.3

1 year ago

0.3.1

1 year ago

0.2.2

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.1.0

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago