@sequencemedia/eslint-config-typescript 0.1.3 → 0.1.4

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.
@@ -0,0 +1,9 @@
1
+ import merge from '@sequencemedia/eslint-merge'
2
+
3
+ import eslintConfig from '#eslint-config-typescript/configs/recommended'
4
+
5
+ export default function mergeESLintConfigWith (config) {
6
+ return (
7
+ merge(eslintConfig, config)
8
+ )
9
+ }
@@ -0,0 +1,9 @@
1
+ import merge from '@sequencemedia/eslint-merge'
2
+
3
+ import eslintConfig from '#eslint-config-typescript/configs/typescript'
4
+
5
+ export default function mergeESLintConfigWith (config) {
6
+ return (
7
+ merge(eslintConfig, config)
8
+ )
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequencemedia/eslint-config-typescript",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "TypeScript configuration for ESLint 9",
5
5
  "keywords": [
6
6
  "JavaScript TypeScript Style",
@@ -61,7 +61,7 @@
61
61
  "globals": "^15.13.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@sequencemedia/eslint-config-standard": "^0.2.3",
64
+ "@sequencemedia/eslint-config-standard": "^0.2.4",
65
65
  "chai": "^5.1.2",
66
66
  "eslint": "^9.16.0",
67
67
  "husky": "^9.1.7",
@@ -75,14 +75,12 @@
75
75
  "#eslint-config-typescript/common": "./common/index.mjs",
76
76
  "#eslint-config-typescript/configs": "./configs/index.mjs",
77
77
  "#eslint-config-typescript/configs/*": "./configs/*.mjs",
78
- "#eslint-config-typescript/merge": "./merge.mjs",
79
- "#eslint-config-typescript/merge/*": "./merge/*.mjs"
78
+ "#eslint-config-typescript/merge": "./merge.mjs"
80
79
  },
81
80
  "exports": {
82
81
  ".": "./index.mjs",
83
82
  "./configs": "./configs/index.mjs",
84
83
  "./configs/*": "./configs/*.mjs",
85
- "./merge": "./merge.mjs",
86
- "./merge/*": "./merge/*.mjs"
84
+ "./merge": "./merge.mjs"
87
85
  }
88
86
  }
@@ -4,9 +4,9 @@ import {
4
4
 
5
5
  import RECOMMENDED from '@sequencemedia/eslint-config-typescript/configs/recommended'
6
6
 
7
- import merge from '@sequencemedia/eslint-config-typescript/merge/recommended'
7
+ import merge from '@sequencemedia/eslint-config-typescript/configs/recommended/merge'
8
8
 
9
- describe('@sequencemedia/eslint-config-typescript/merge/recommended', () => {
9
+ describe('@sequencemedia/eslint-config-typescript/configs/recommended/merge', () => {
10
10
  describe('`merge`', () => it('is a function', () => expect(merge).to.be.a('function')))
11
11
 
12
12
  describe('`merge()`', () => {
@@ -24,7 +24,10 @@ describe('@sequencemedia/eslint-config-typescript/merge/recommended', () => {
24
24
  mockOption: 'MOCK LANGUAGE OPTIONS'
25
25
  }
26
26
  const MOCK_LINTER_OPTIONS = {
27
- mockOptions: 'MOCK LINTER OPTIONS'
27
+ mockOption: 'MOCK LINTER OPTIONS'
28
+ }
29
+ const MOCK_PLUGINS = {
30
+ mockOption: 'MOCK PLUGINS'
28
31
  }
29
32
  const MOCK_RULES = {
30
33
  mockOption: 'MOCK RULES'
@@ -36,7 +39,9 @@ describe('@sequencemedia/eslint-config-typescript/merge/recommended', () => {
36
39
  const {
37
40
  languageOptions: RECOMMENDED_LANGUAGE_OPTIONS,
38
41
  linterOptions: RECOMMENDED_LINTER_OPTIONS,
39
- rules: RECOMMENDED_RULES
42
+ plugins: RECOMMENDED_PLUGINS,
43
+ rules: RECOMMENDED_RULES,
44
+ settings: RECOMMENDED_SETTINGS
40
45
  } = RECOMMENDED
41
46
 
42
47
  return (
@@ -46,6 +51,7 @@ describe('@sequencemedia/eslint-config-typescript/merge/recommended', () => {
46
51
  ignores: MOCK_IGNORES,
47
52
  languageOptions: MOCK_LANGUAGE_OPTIONS,
48
53
  linterOptions: MOCK_LINTER_OPTIONS,
54
+ plugins: MOCK_PLUGINS,
49
55
  rules: MOCK_RULES,
50
56
  settings: MOCK_SETTINGS
51
57
  })
@@ -62,11 +68,18 @@ describe('@sequencemedia/eslint-config-typescript/merge/recommended', () => {
62
68
  ...RECOMMENDED_LINTER_OPTIONS,
63
69
  ...MOCK_LINTER_OPTIONS
64
70
  },
71
+ plugins: {
72
+ ...RECOMMENDED_PLUGINS,
73
+ ...MOCK_PLUGINS
74
+ },
65
75
  rules: {
66
76
  ...RECOMMENDED_RULES,
67
77
  ...MOCK_RULES
68
78
  },
69
- settings: MOCK_SETTINGS
79
+ settings: {
80
+ ...RECOMMENDED_SETTINGS,
81
+ ...MOCK_SETTINGS
82
+ }
70
83
  })
71
84
  )
72
85
  })
@@ -4,9 +4,9 @@ import {
4
4
 
5
5
  import TYPESCRIPT from '@sequencemedia/eslint-config-typescript/configs/typescript'
6
6
 
7
- import merge from '@sequencemedia/eslint-config-typescript/merge/typescript'
7
+ import merge from '@sequencemedia/eslint-config-typescript/configs/typescript/merge'
8
8
 
9
- describe('@sequencemedia/eslint-config-typescript/merge/typescript', () => {
9
+ describe('@sequencemedia/eslint-config-typescript/configs/typescript/merge', () => {
10
10
  describe('`merge`', () => it('is a function', () => expect(merge).to.be.a('function')))
11
11
 
12
12
  describe('`merge()`', () => {
@@ -24,7 +24,10 @@ describe('@sequencemedia/eslint-config-typescript/merge/typescript', () => {
24
24
  mockOption: 'MOCK LANGUAGE OPTIONS'
25
25
  }
26
26
  const MOCK_LINTER_OPTIONS = {
27
- mockOptions: 'MOCK LINTER OPTIONS'
27
+ mockOption: 'MOCK LINTER OPTIONS'
28
+ }
29
+ const MOCK_PLUGINS = {
30
+ mockOption: 'MOCK PLUGINS'
28
31
  }
29
32
  const MOCK_RULES = {
30
33
  mockOption: 'MOCK RULES'
@@ -34,7 +37,11 @@ describe('@sequencemedia/eslint-config-typescript/merge/typescript', () => {
34
37
  }
35
38
 
36
39
  const {
37
- rules: TYPESCRIPT_RULES
40
+ languageOptions: TYPESCRIPT_LANGUAGE_OPTIONS,
41
+ linterOptions: TYPESCRIPT_LINTER_OPTIONS,
42
+ plugins: TYPESCRIPT_PLUGINS,
43
+ rules: TYPESCRIPT_RULES,
44
+ settings: TYPESCRIPT_SETTINGS
38
45
  } = TYPESCRIPT
39
46
 
40
47
  return (
@@ -44,6 +51,7 @@ describe('@sequencemedia/eslint-config-typescript/merge/typescript', () => {
44
51
  ignores: MOCK_IGNORES,
45
52
  languageOptions: MOCK_LANGUAGE_OPTIONS,
46
53
  linterOptions: MOCK_LINTER_OPTIONS,
54
+ plugins: MOCK_PLUGINS,
47
55
  rules: MOCK_RULES,
48
56
  settings: MOCK_SETTINGS
49
57
  })
@@ -52,13 +60,26 @@ describe('@sequencemedia/eslint-config-typescript/merge/typescript', () => {
52
60
  ...TYPESCRIPT,
53
61
  files: MOCK_FILES,
54
62
  ignores: MOCK_IGNORES,
55
- languageOptions: MOCK_LANGUAGE_OPTIONS,
56
- linterOptions: MOCK_LINTER_OPTIONS,
63
+ languageOptions: {
64
+ ...TYPESCRIPT_LANGUAGE_OPTIONS,
65
+ ...MOCK_LANGUAGE_OPTIONS
66
+ },
67
+ linterOptions: {
68
+ ...TYPESCRIPT_LINTER_OPTIONS,
69
+ ...MOCK_LINTER_OPTIONS
70
+ },
71
+ plugins: {
72
+ ...TYPESCRIPT_PLUGINS,
73
+ ...MOCK_PLUGINS
74
+ },
57
75
  rules: {
58
76
  ...TYPESCRIPT_RULES,
59
77
  ...MOCK_RULES
60
78
  },
61
- settings: MOCK_SETTINGS
79
+ settings: {
80
+ ...TYPESCRIPT_SETTINGS,
81
+ ...MOCK_SETTINGS
82
+ }
62
83
  })
63
84
  )
64
85
  })
@@ -2,9 +2,7 @@ import {
2
2
  expect
3
3
  } from 'chai'
4
4
 
5
- import parser from '@typescript-eslint/parser'
6
-
7
- import TYPESCRIPT from '@sequencemedia/eslint-config-typescript/configs/typescript'
5
+ import eslintConfig from '@sequencemedia/eslint-config-typescript'
8
6
 
9
7
  import merge from '@sequencemedia/eslint-config-typescript/merge'
10
8
 
@@ -15,6 +13,11 @@ describe('@sequencemedia/eslint-config-typescript/merge', () => {
15
13
  describe('Always', () => it('returns an array', () => expect(merge()).to.be.an('array')))
16
14
 
17
15
  describe('Merges', () => {
16
+ const [
17
+ DEFAULT,
18
+ TYPESCRIPT
19
+ ] = eslintConfig
20
+
18
21
  it('returns an array', () => {
19
22
  const MOCK_FILES = [
20
23
  'MOCK FILES'
@@ -28,6 +31,9 @@ describe('@sequencemedia/eslint-config-typescript/merge', () => {
28
31
  const MOCK_LINTER_OPTIONS = {
29
32
  mockOption: 'MOCK LINTER OPTIONS'
30
33
  }
34
+ const MOCK_PLUGINS = {
35
+ mockOption: 'MOCK PLUGINS'
36
+ }
31
37
  const MOCK_RULES = {
32
38
  mockOption: 'MOCK RULES'
33
39
  }
@@ -38,7 +44,9 @@ describe('@sequencemedia/eslint-config-typescript/merge', () => {
38
44
  const {
39
45
  languageOptions: TYPESCRIPT_LANGUAGE_OPTIONS,
40
46
  linterOptions: TYPESCRIPT_LINTER_OPTIONS,
41
- rules: TYPESCRIPT_RULES
47
+ plugins: TYPESCRIPT_PLUGINS,
48
+ rules: TYPESCRIPT_RULES,
49
+ settings: TYPESCRIPT_SETTINGS
42
50
  } = TYPESCRIPT
43
51
 
44
52
  return (
@@ -48,27 +56,13 @@ describe('@sequencemedia/eslint-config-typescript/merge', () => {
48
56
  ignores: MOCK_IGNORES,
49
57
  languageOptions: MOCK_LANGUAGE_OPTIONS,
50
58
  linterOptions: MOCK_LINTER_OPTIONS,
59
+ plugins: MOCK_PLUGINS,
51
60
  rules: MOCK_RULES,
52
61
  settings: MOCK_SETTINGS
53
62
  })
54
63
  )
55
64
  .to.eql([
56
- {
57
- name: '@sequencemedia/eslint-config-typescript',
58
- languageOptions: {
59
- parser,
60
- parserOptions: {
61
- projectService: true,
62
- project: 'tsconfig.json'
63
- }
64
- },
65
- linterOptions: {
66
- reportUnusedDisableDirectives: 'error'
67
- },
68
- files: [
69
- '**/*.{ts,mts,cts}'
70
- ]
71
- },
65
+ DEFAULT,
72
66
  {
73
67
  ...TYPESCRIPT,
74
68
  files: MOCK_FILES,
@@ -81,11 +75,18 @@ describe('@sequencemedia/eslint-config-typescript/merge', () => {
81
75
  ...TYPESCRIPT_LINTER_OPTIONS,
82
76
  ...MOCK_LINTER_OPTIONS
83
77
  },
78
+ plugins: {
79
+ ...TYPESCRIPT_PLUGINS,
80
+ ...MOCK_PLUGINS
81
+ },
84
82
  rules: {
85
83
  ...TYPESCRIPT_RULES,
86
84
  ...MOCK_RULES
87
85
  },
88
- settings: MOCK_SETTINGS
86
+ settings: {
87
+ ...TYPESCRIPT_SETTINGS,
88
+ ...MOCK_SETTINGS
89
+ }
89
90
  }
90
91
  ])
91
92
  )
@@ -1,12 +0,0 @@
1
- import merge from '@sequencemedia/eslint-merge'
2
-
3
- import CONFIG from '#eslint-config-typescript/configs/recommended'
4
-
5
- export default function mergeConfig (config) {
6
- return (
7
- merge(
8
- CONFIG,
9
- config
10
- )
11
- )
12
- }
@@ -1,12 +0,0 @@
1
- import merge from '@sequencemedia/eslint-merge'
2
-
3
- import CONFIG from '#eslint-config-typescript/configs/typescript'
4
-
5
- export default function mergeConfig (config) {
6
- return (
7
- merge(
8
- CONFIG,
9
- config
10
- )
11
- )
12
- }