@1stg/eslint-config 11.0.0 → 12.0.0

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/recommended.js DELETED
@@ -1,6 +0,0 @@
1
- // @ts-check
2
-
3
- import { base } from './base.js'
4
- import { overrides } from './overrides.js'
5
-
6
- export const recommended = [...base, ...overrides]
package/test.js DELETED
@@ -1,14 +0,0 @@
1
- // @ts-check
2
-
3
- /** @import { TSESLint } from '@typescript-eslint/utils' */
4
-
5
- import { nonSourceRules } from './_util.js'
6
-
7
- /** @satisfies {TSESLint.FlatConfig.Config} */
8
- export const test = {
9
- name: '@1stg/test',
10
- files: ['**/{__test__,test,tests}/**/*'],
11
- rules: nonSourceRules,
12
- }
13
-
14
- export const tests = test
package/ts-base.js DELETED
@@ -1,139 +0,0 @@
1
- // @ts-check
2
-
3
- import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript'
4
- import importX from 'eslint-plugin-import-x'
5
- import tseslint from 'typescript-eslint'
6
-
7
- import { prettierExtends, project } from './_util.js'
8
-
9
- export const resolveSettings = {
10
- 'import-x/external-module-folders': [
11
- 'node_modules',
12
- 'node_modules/@d-ts',
13
- 'node_modules/@types',
14
- ],
15
- 'import-x/resolver-next': [
16
- createTypeScriptImportResolver({
17
- alwaysTryTypes: true,
18
- project,
19
- }),
20
- ],
21
- }
22
-
23
- export const tsBase = tseslint.config({
24
- name: '@1stg/ts-base',
25
- files: ['**/*.{cts,mts,ts,tsx}'],
26
- languageOptions: {
27
- parserOptions: {
28
- projectService: true,
29
- },
30
- },
31
- extends: [
32
- tseslint.configs.eslintRecommended,
33
- tseslint.configs.recommended,
34
- importX.flatConfigs.typescript,
35
- prettierExtends,
36
- ],
37
- settings: resolveSettings,
38
- rules: {
39
- '@typescript-eslint/adjacent-overload-signatures': 2,
40
- '@typescript-eslint/array-type': [
41
- 2,
42
- {
43
- default: 'array-simple',
44
- },
45
- ],
46
- '@typescript-eslint/ban-ts-comment': 0,
47
- '@typescript-eslint/consistent-type-definitions': [2, 'interface'],
48
- '@typescript-eslint/explicit-function-return-type': 0,
49
- '@typescript-eslint/explicit-member-accessibility': [
50
- 2,
51
- {
52
- accessibility: 'no-public',
53
- overrides: {
54
- parameterProperties: 'off',
55
- },
56
- },
57
- ],
58
- '@typescript-eslint/explicit-module-boundary-types': 0,
59
- '@typescript-eslint/member-ordering': 2,
60
- // eslint-disable-next-line sonarjs/todo-tag
61
- // TODO: find better config
62
- '@typescript-eslint/naming-convention': 0,
63
- '@typescript-eslint/no-empty-function': 2,
64
- '@typescript-eslint/no-extraneous-class': [
65
- 2,
66
- {
67
- allowWithDecorator: true,
68
- },
69
- ],
70
- '@typescript-eslint/no-for-in-array': 2,
71
- '@typescript-eslint/no-non-null-assertion': 0,
72
- '@typescript-eslint/no-parameter-properties': 0,
73
- '@typescript-eslint/no-require-imports': 2,
74
- '@typescript-eslint/no-this-alias': [
75
- 2,
76
- {
77
- allowDestructuring: true,
78
- allowedNames: ['self'],
79
- },
80
- ],
81
- '@typescript-eslint/no-use-before-define': [
82
- 2,
83
- {
84
- classes: false,
85
- functions: false,
86
- },
87
- ],
88
- '@typescript-eslint/no-useless-constructor': 2,
89
- '@typescript-eslint/no-unused-vars': [
90
- 2,
91
- {
92
- argsIgnorePattern: '^_',
93
- varsIgnorePattern: '^_',
94
- },
95
- ],
96
- '@typescript-eslint/prefer-for-of': 2,
97
- '@typescript-eslint/prefer-function-type': 2,
98
- '@typescript-eslint/prefer-ts-expect-error': 2,
99
- '@typescript-eslint/sort-type-constituents': 2,
100
- '@typescript-eslint/triple-slash-reference': [
101
- 2,
102
- {
103
- lib: 'never',
104
- path: 'always',
105
- types: 'prefer-import',
106
- },
107
- ],
108
- '@typescript-eslint/unified-signatures': 2,
109
- camelcase: 0,
110
- 'import-x/default': 0,
111
- 'import-x/named': 0,
112
- 'import-x/namespace': 0,
113
- 'import-x/no-duplicates': 2,
114
- 'import-x/no-named-as-default': 0,
115
- 'import-x/no-named-as-default-member': 0,
116
- 'no-empty-function': 0,
117
- 'no-restricted-syntax': [
118
- 2,
119
- {
120
- selector:
121
- 'TSTypeAliasDeclaration > .typeAnnotation[type=/^(TS.*Keyword|TSTypeReference)$/]:not(:has(TSTypeParameterInstantiation)):not(:has(TSQualifiedName))',
122
- message:
123
- 'Type alias references simple `Ts*Keyword`s or `TSTypeReference` only is not allowed',
124
- },
125
- ],
126
- 'no-unused-vars': 0,
127
- 'no-use-before-define': 0,
128
- 'no-useless-constructor': 0,
129
- // covered by @typescript-eslint/no-floating-promises
130
- 'promise/always-return': 0,
131
- 'promise/catch-or-return': 0,
132
- // ts itself has guaranteed it
133
- 'unicorn-x/no-array-callback-reference': 0,
134
- // covered by @typescript-eslint/no-extraneous-class
135
- 'unicorn-x/no-static-only-class': 0,
136
- // covered by @typescript-eslint/no-this-alias
137
- 'unicorn-x/no-this-assignment': 0,
138
- },
139
- })
package/vitest.js DELETED
@@ -1,17 +0,0 @@
1
- // @ts-check
2
-
3
- import vitest_ from '@vitest/eslint-plugin'
4
- import globals from 'globals'
5
- import tseslint from 'typescript-eslint'
6
-
7
- import { test } from './test.js'
8
-
9
- export const vitest = tseslint.config({
10
- name: '@1stg/vitest',
11
- files: ['**/*.{spec,test}.{js,jsx,ts,tsx}'],
12
- extends: [vitest_.configs.recommended],
13
- languageOptions: {
14
- globals: globals.vitest,
15
- },
16
- rules: test.rules,
17
- })
package/vue.js DELETED
@@ -1,58 +0,0 @@
1
- // @ts-check
2
-
3
- import babelParser from '@babel/eslint-parser'
4
- import * as markup from 'eslint-plugin-markup'
5
- import vue_ from 'eslint-plugin-vue'
6
- import tseslint from 'typescript-eslint'
7
- import vueParser from 'vue-eslint-parser'
8
-
9
- import { isTsAvailable, prettierExtends } from './_util.js'
10
- import { jsBase } from './js-base.js'
11
- import { tsBase } from './ts-base.js'
12
-
13
- const vueExtends = tseslint.config(
14
- vue_.configs['flat/recommended'],
15
- prettierExtends,
16
- )
17
-
18
- export const vue = tseslint.config(
19
- {
20
- ...jsBase,
21
- name: '@1stg/js-vue',
22
- files: /** @type {string[]} */ (
23
- [...jsBase.files, !isTsAvailable && '**/*.vue'].filter(Boolean)
24
- ),
25
- languageOptions: {
26
- parser: vueParser,
27
- parserOptions: {
28
- ...jsBase.languageOptions.parserOptions,
29
- parser: babelParser,
30
- },
31
- },
32
- extends: vueExtends,
33
- },
34
- isTsAvailable
35
- ? {
36
- name: '@1stg/ts-vue',
37
- extends: [...tsBase, ...vueExtends],
38
- files: [.../** @type {string[]} */ (tsBase[0].files), '**/*.vue'],
39
- languageOptions: {
40
- parser: vueParser,
41
- parserOptions: {
42
- ...tsBase[0].languageOptions?.parserOptions,
43
- parser: tseslint.parser,
44
- extraFileExtensions: ['.vue'],
45
- },
46
- },
47
- }
48
- : [],
49
- {
50
- name: '@1stg/vue',
51
- files: ['**/*.vue'],
52
- extends: [markup.configs.flatRecommended, ...vueExtends],
53
- rules: {
54
- 'no-unused-vars': 0,
55
- '@typescript-eslint/no-unused-vars': 0,
56
- },
57
- },
58
- )