0.12.0 • Published 7 months ago
@woohm402/eslint-config-base v0.12.0
@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
orimport.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.
- This rule disallows the use of eslint comments e.g.
'no-restricted-syntax': ['error', ...]
aboutconsole.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
orconsole.error
.
- This rule disallows usage of
'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.
- This rule disallows usage of
'@typescript-eslint/no-shadow'
'@typescript-eslint/restrict-template-expressions'
'@typescript-eslint/strict-boolean-expressions'
0.12.0
7 months ago
0.11.0
8 months ago
0.10.0
8 months ago
0.9.0
9 months ago
0.8.0
9 months ago
0.7.2
10 months ago
0.7.1
10 months ago
0.7.4
10 months ago
0.7.3
10 months ago
0.7.0
11 months ago
0.6.0
11 months ago
0.5.0
12 months ago
0.4.0
12 months 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