@cenk1cenk2/eslint-config 3.1.0 → 3.1.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [3.1.2](https://gitlab.kilic.dev/config/eslint-config/compare/v3.1.1...v3.1.2) (2024-10-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update configuration with the file types ([42843c9](https://gitlab.kilic.dev/config/eslint-config/commit/42843c90630c15223f53c246ceb69532d093cc53))
7
+
8
+ ## [3.1.1](https://gitlab.kilic.dev/config/eslint-config/compare/v3.1.0...v3.1.1) (2024-10-19)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * update extensions configuration ([38d5a15](https://gitlab.kilic.dev/config/eslint-config/commit/38d5a154ef27b3b9ec2da2e412287cd73fb0140a))
14
+
1
15
  # [3.1.0](https://gitlab.kilic.dev/config/eslint-config/compare/v3.0.16...v3.1.0) (2024-10-19)
2
16
 
3
17
 
package/constants.js CHANGED
@@ -1 +1,15 @@
1
- export const EXTENSIONS = ['**/*.js', '**/*.mjs', '**/*.cjs', '**/*.ts', '**/*.mts', '**/*.cts', '**/*.jsx', '**/*.tsx', '**/*.vue', '**/*.svelte']
1
+ export function mapExtensions(extensions) {
2
+ return extensions.flatMap((ext) => [`*.${ext}`, `**/*.${ext}`])
3
+ }
4
+
5
+ const javascript = ['js', 'mjs', 'cjs', 'jsx']
6
+ const typescript = ['ts', 'mts', 'cts', 'tsx']
7
+ const vue = ['vue']
8
+ const svelte = ['svelte']
9
+
10
+ export const EXTENSIONS_JAVASCRIPT = mapExtensions(javascript)
11
+ export const EXTENSIONS_TYPESCRIPT = mapExtensions(typescript)
12
+ export const EXTENSIONS_VUE = mapExtensions(vue)
13
+ export const EXTENSIONS_SVELTE = mapExtensions(svelte)
14
+
15
+ export const EXTENSIONS = [...EXTENSIONS_JAVASCRIPT, ...EXTENSIONS_TYPESCRIPT, ...EXTENSIONS_VUE, ...EXTENSIONS_SVELTE]
package/eslint.config.js CHANGED
@@ -1,9 +1,10 @@
1
+ import { EXTENSIONS_JAVASCRIPT } from './constants.js'
1
2
  import ConfigJavascript from './javascript.js'
2
3
 
3
4
  /** @type {import("eslint").Linter.Config[]} */
4
5
  export default [
5
6
  ...ConfigJavascript,
6
7
  {
7
- files: ['**/*.js']
8
+ files: [...EXTENSIONS_JAVASCRIPT]
8
9
  }
9
10
  ]
package/import-strict.js CHANGED
@@ -4,6 +4,7 @@ import { EXTENSIONS } from './constants.js'
4
4
  /** @type {import("eslint").Linter.Config[]} */
5
5
  export default [
6
6
  {
7
+ name: 'cenk1cenk2/import/strict',
7
8
  files: [...EXTENSIONS],
8
9
  plugins: {
9
10
  import: ImportPlugin
package/import.js CHANGED
@@ -4,6 +4,7 @@ import { EXTENSIONS } from './constants.js'
4
4
  /** @type {import("eslint").Linter.Config[]} */
5
5
  export default [
6
6
  {
7
+ name: 'cenk1cenk2/import/recommended',
7
8
  files: [...EXTENSIONS],
8
9
  plugins: { import: ImportPlugin },
9
10
  rules: {
package/index.js CHANGED
@@ -4,6 +4,7 @@ import ConfigJavascript from './javascript.js'
4
4
  import ConfigTypescriptDynamic from './typescript-dynamic.js'
5
5
  import ConfigTypescript from './typescript.js'
6
6
  import * as utils from './utils.js'
7
+ import * as constants from './constants.js'
7
8
 
8
9
  export const configs = {
9
10
  ['javascript']: ConfigJavascript,
@@ -13,4 +14,4 @@ export const configs = {
13
14
  ['typescript-dynamic']: ConfigTypescriptDynamic
14
15
  }
15
16
 
16
- export { utils }
17
+ export { utils, constants }
package/javascript.js CHANGED
@@ -7,8 +7,11 @@ import { EXTENSIONS } from './constants.js'
7
7
  /** @type {import("eslint").Linter.Config[]} */
8
8
  export default [
9
9
  JavascriptPlugin.configs.recommended,
10
+
10
11
  ...ConfigImports,
12
+
11
13
  {
14
+ name: 'cenk1cenk2/javascript/recommended',
12
15
  files: [...EXTENSIONS],
13
16
  languageOptions: {
14
17
  globals: {
@@ -30,8 +33,8 @@ export default [
30
33
  'stylistic/linebreak-style': ['error', 'unix'],
31
34
  'sort-imports': 'off',
32
35
  'stylistic/indent': ['error', 2],
33
- 'stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true } ],
34
- 'stylistic/comma-spacing': ['error', { before: false, after: true } ],
36
+ 'stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
37
+ 'stylistic/comma-spacing': ['error', { before: false, after: true }],
35
38
  'stylistic/func-call-spacing': ['error', 'never'],
36
39
  'stylistic/max-len': [
37
40
  'error',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/eslint-config",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "Eslint configuration for my taste.",
5
5
  "main": "index.js",
6
6
  "repository": "git@gitlab.kilic.dev:config/eslint-config.git",
@@ -75,7 +75,8 @@
75
75
  "eslint-plugin-vue": "^9.29.0",
76
76
  "lint-staged": "^15.2.10",
77
77
  "prettier": "^3.3.3",
78
- "simple-git-hooks": "^2.11.1"
78
+ "simple-git-hooks": "^2.11.1",
79
+ "svelte": "^5.0.0"
79
80
  },
80
81
  "config": {
81
82
  "commitizen": {
@@ -1,17 +1,23 @@
1
- import svelte from 'eslint-plugin-svelte'
1
+ import SveltePlugin from 'eslint-plugin-svelte'
2
+ import TypescriptParser from '@typescript-eslint/parser'
3
+ import SvelteParser from 'svelte-eslint-parser'
2
4
 
3
- import typescript from './typescript-dynamic.js'
5
+ import ConfigTypescript from './typescript-dynamic.js'
6
+ import { EXTENSIONS_SVELTE, EXTENSIONS_TYPESCRIPT } from './constants.js'
4
7
 
5
8
  /** @type {import("eslint").Linter.Config[]} */
6
9
  export default [
7
- ...svelte.configs['flat/recommended'],
8
- ...typescript,
10
+ ...SveltePlugin.configs['flat/recommended'],
11
+
12
+ ...ConfigTypescript,
13
+
9
14
  {
10
- files: ['**/*.svelte'],
15
+ name: 'cenk1cenk2/svelte/typescript/recommended',
16
+ files: [...EXTENSIONS_SVELTE],
11
17
  languageOptions: {
12
- parser: 'svelte-eslint-parser',
18
+ parser: SvelteParser,
13
19
  parserOptions: {
14
- parser: '@typescript-eslint/parser',
20
+ parser: TypescriptParser,
15
21
  extraFileExtensions: ['.svelte']
16
22
  }
17
23
  },
@@ -1,10 +1,12 @@
1
+ import { EXTENSIONS_TYPESCRIPT } from './constants.js'
1
2
  import ConfigTypescript from './typescript.js'
2
3
 
3
4
  /** @type {import("eslint").Linter.Config[]} */
4
5
  export default [
5
6
  ...ConfigTypescript,
6
7
  {
7
- files: ['**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte'],
8
+ name: 'cenk1cenk2/typescript-dynamic/recommended',
9
+ files: [...EXTENSIONS_TYPESCRIPT],
8
10
  languageOptions: {
9
11
  parserOptions: {
10
12
  project: 'tsconfig.json'
@@ -24,7 +26,7 @@ export default [
24
26
  disallowTypeAnnotations: true
25
27
  }
26
28
  ],
27
- '@typescript-eslint/consistent-type-exports': ['error', { fixMixedExportsWithInlineTypeSpecifier: false } ]
29
+ '@typescript-eslint/consistent-type-exports': ['error', { fixMixedExportsWithInlineTypeSpecifier: false }]
28
30
  }
29
31
  }
30
32
  ]
package/typescript.js CHANGED
@@ -1,13 +1,19 @@
1
1
  import TypescriptEslintPlugin from '@typescript-eslint/eslint-plugin'
2
2
  import TypescriptEslint from 'typescript-eslint'
3
3
  import ConfigJavascript from './javascript.js'
4
+ import { EXTENSIONS_TYPESCRIPT } from './constants.js'
4
5
 
5
6
  /** @type {import("eslint").Linter.Config[]} */
6
7
  export default [
7
8
  ...ConfigJavascript,
8
- ...TypescriptEslint.configs.recommended,
9
+ ...TypescriptEslint.configs.recommended.map((config) => {
10
+ config.files = [...EXTENSIONS_TYPESCRIPT]
11
+
12
+ return config
13
+ }),
9
14
  {
10
- files: ['**/*.ts', '**/*.tsx'],
15
+ name: 'cenk1cenk2/typescript/recommended',
16
+ files: [...EXTENSIONS_TYPESCRIPT],
11
17
  plugins: {
12
18
  '@typescript-eslint': TypescriptEslintPlugin
13
19
  },
@@ -226,9 +232,9 @@ export default [
226
232
  '@typescript-eslint/prefer-function-type': 'error',
227
233
  '@typescript-eslint/unified-signatures': 'error',
228
234
  '@typescript-eslint/no-use-before-define': 'off',
229
- '@typescript-eslint/array-type': ['error', { default: 'array' } ],
235
+ '@typescript-eslint/array-type': ['error', { default: 'array' }],
230
236
  '@typescript-eslint/consistent-indexed-object-style': ['error', 'record'],
231
- '@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' } ],
237
+ '@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }],
232
238
  '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
233
239
  '@typescript-eslint/method-signature-style': ['error', 'property'],
234
240
  '@typescript-eslint/no-empty-object-type': [
package/vue-typescript.js CHANGED
@@ -1,12 +1,10 @@
1
- import VuePlugin from 'eslint-plugin-vue'
2
1
  import VueTypescriptConfig from '@vue/eslint-config-typescript'
2
+ import VuePlugin from 'eslint-plugin-vue'
3
+ import { EXTENSIONS_VUE } from './constants.js'
3
4
  import ConfigTypescript from './typescript-dynamic.js'
4
- import { EXTENSIONS } from './constants.js'
5
5
 
6
6
  /** @type {import("eslint").Linter.Config[]} */
7
7
  export default [
8
- ...ConfigTypescript,
9
-
10
8
  ...VuePlugin.configs['flat/essential'],
11
9
 
12
10
  ...VueTypescriptConfig({
@@ -21,8 +19,11 @@ export default [
21
19
  }
22
20
  }),
23
21
 
22
+ ...ConfigTypescript,
23
+
24
24
  {
25
- files: [...EXTENSIONS],
25
+ name: 'cenk1cenk2/vue/typescript/recommended',
26
+ files: [...EXTENSIONS_VUE],
26
27
  rules: {
27
28
  'vue/multi-word-component-names': 'off'
28
29
  }