@dmitryrechkin/eslint-standard 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.npmignore ADDED
@@ -0,0 +1,3 @@
1
+ node_modules
2
+ package-lock.json
3
+ bun.lockb
package/eslint.config.mjs CHANGED
@@ -3,80 +3,82 @@ import tsParser from '@typescript-eslint/parser';
3
3
  import tsPlugin from '@typescript-eslint/eslint-plugin';
4
4
  import unusedImportsPlugin from 'eslint-plugin-unused-imports';
5
5
 
6
- export default [
7
- {
8
- ignores: ['node_modules/**', 'dist/**'],
9
- },
10
- {
11
- files: ['**/*.ts'],
12
- languageOptions: {
13
- parser: tsParser,
14
- parserOptions: {
15
- ecmaVersion: 2020,
16
- sourceType: 'module',
17
- project: './tsconfig.json',
18
- },
19
- },
20
- plugins: {
21
- '@typescript-eslint': tsPlugin,
22
- 'unused-imports': unusedImportsPlugin,
6
+ export default function ({ tsconfigPath = './tsconfig.json' } = {}) {
7
+ return [
8
+ {
9
+ ignores: ['node_modules/**', 'dist/**'],
23
10
  },
24
- rules: {
25
- '@typescript-eslint/explicit-function-return-type': 'error',
26
- //'linebreak-style': 'off', // Disable linebreak style rule
27
- '@typescript-eslint/no-explicit-any': 'off', // Turn off the rule for no-explicit-any
11
+ {
12
+ files: ['**/*.{js,jsx,ts,tsx}'],
13
+ languageOptions: {
14
+ parser: tsParser,
15
+ parserOptions: {
16
+ ecmaVersion: 2020,
17
+ sourceType: 'module',
18
+ project: tsconfigPath,
19
+ },
20
+ },
21
+ plugins: {
22
+ '@typescript-eslint': tsPlugin,
23
+ 'unused-imports': unusedImportsPlugin,
24
+ },
25
+ rules: {
26
+ '@typescript-eslint/explicit-function-return-type': 'error',
27
+ //'linebreak-style': 'off', // Disable linebreak style rule
28
+ '@typescript-eslint/no-explicit-any': 'off', // Turn off the rule for no-explicit-any
28
29
 
29
- /// coding guidelines
30
- 'brace-style': ['error', 'allman', { allowSingleLine: true }], // Use Allman style for braces
31
- indent: ['error', 'tab', { SwitchCase: 1 }],
32
- quotes: ['error', 'single'],
33
- semi: ['error', 'always'],
34
- '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
35
- 'no-trailing-spaces': 'error',
36
- 'eol-last': ['error', 'always'],
37
- 'comma-dangle': ['error', 'never'],
30
+ /// coding guidelines
31
+ 'brace-style': ['error', 'allman', { allowSingleLine: true }], // Use Allman style for braces
32
+ indent: ['error', 'tab', { SwitchCase: 1 }],
33
+ quotes: ['error', 'single'],
34
+ semi: ['error', 'always'],
35
+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
36
+ 'no-trailing-spaces': 'error',
37
+ 'eol-last': ['error', 'always'],
38
+ 'comma-dangle': ['error', 'never'],
38
39
 
39
- // naming conventions
40
- '@typescript-eslint/naming-convention': [
41
- 'error',
42
- {
43
- selector: 'variableLike',
44
- format: ['camelCase'],
45
- leadingUnderscore: 'forbid',
46
- },
47
- {
48
- selector: 'function',
49
- format: ['camelCase'],
50
- leadingUnderscore: 'forbid',
51
- },
52
- {
53
- selector: 'class',
54
- format: ['PascalCase'],
55
- leadingUnderscore: 'forbid',
56
- },
57
- {
58
- selector: 'parameter',
59
- format: ['camelCase'],
60
- leadingUnderscore: 'forbid',
61
- },
62
- {
63
- selector: 'memberLike',
64
- format: ['camelCase'],
65
- leadingUnderscore: 'forbid',
66
- },
67
- ],
40
+ // naming conventions
41
+ '@typescript-eslint/naming-convention': [
42
+ 'error',
43
+ {
44
+ selector: 'variableLike',
45
+ format: ['camelCase'],
46
+ leadingUnderscore: 'forbid',
47
+ },
48
+ {
49
+ selector: 'function',
50
+ format: ['camelCase'],
51
+ leadingUnderscore: 'forbid',
52
+ },
53
+ {
54
+ selector: 'class',
55
+ format: ['PascalCase'],
56
+ leadingUnderscore: 'forbid',
57
+ },
58
+ {
59
+ selector: 'parameter',
60
+ format: ['camelCase'],
61
+ leadingUnderscore: 'forbid',
62
+ },
63
+ {
64
+ selector: 'memberLike',
65
+ format: ['camelCase'],
66
+ leadingUnderscore: 'forbid',
67
+ },
68
+ ],
68
69
 
69
- // unused-imports rules
70
- 'unused-imports/no-unused-imports-ts': 'error',
71
- 'unused-imports/no-unused-vars-ts': [
72
- 'warn',
73
- {
74
- vars: 'all',
75
- varsIgnorePattern: '^_',
76
- args: 'after-used',
77
- argsIgnorePattern: '^_',
78
- },
79
- ],
70
+ // unused-imports rules
71
+ 'unused-imports/no-unused-imports': 'error',
72
+ 'unused-imports/no-unused-vars': [
73
+ 'warn',
74
+ {
75
+ vars: 'all',
76
+ varsIgnorePattern: '^_',
77
+ args: 'after-used',
78
+ argsIgnorePattern: '^_',
79
+ },
80
+ ],
81
+ },
80
82
  },
81
- },
82
- ];
83
+ ];
84
+ }
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@dmitryrechkin/eslint-standard",
3
3
  "description": "This package provides a shared ESLint configuration which includes TypeScript support and a set of specific linting rules designed to ensure high-quality and consistent code style across projects.",
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
5
5
  "main": "eslint.config.mjs",
6
6
  "scripts": {
7
- "postinstall": "echo 'Remember to install peer dependencies:\n npm install eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-unused-imports --save-dev\n bun add eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-unused-imports --dev'"
7
+ "postinstall": "echo 'Remember to install peer dependencies:\n npm install eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-unused-imports --save-dev\n bun add eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-unused-imports --dev'",
8
+ "package:publish": "bunx publish --access public"
8
9
  },
9
10
  "keywords": [],
10
11
  "author": "",