@sequencemedia/eslint-config-typescript 0.0.4 → 0.0.6

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 @@
1
+ export { default as typescript } from './typescript.mjs'
@@ -9,15 +9,15 @@ import i from 'eslint-plugin-import'
9
9
 
10
10
  export default {
11
11
  name: '@sequencemedia/eslint-config-typescript/typescript',
12
- linterOptions: {
13
- reportUnusedDisableDirectives: 'error'
14
- },
15
12
  languageOptions: {
16
13
  parser,
17
14
  parserOptions: {
18
15
  projectService: true
19
16
  }
20
17
  },
18
+ linterOptions: {
19
+ reportUnusedDisableDirectives: 'error'
20
+ },
21
21
  plugins: {
22
22
  '@typescript-eslint': t,
23
23
  'eslint-comments': c,
package/merge.mjs CHANGED
@@ -2,9 +2,22 @@ import getMapMerge from '@sequencemedia/eslint-merge/get-map-merge'
2
2
 
3
3
  import eslintConfig from './index.mjs'
4
4
 
5
+ function include ({ name }) {
6
+ return name === '@sequencemedia/eslint-config-stylistic'
7
+ }
8
+
9
+ function exclude ({ name }) {
10
+ return name !== '@sequencemedia/eslint-config-stylistic'
11
+ }
12
+
5
13
  export default function mergeESLintConfigWith (config) {
6
14
  return (
7
15
  eslintConfig
8
- .map(getMapMerge(config))
16
+ .filter(include)
17
+ .concat(
18
+ eslintConfig
19
+ .filter(exclude)
20
+ .map(getMapMerge(config))
21
+ )
9
22
  )
10
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequencemedia/eslint-config-typescript",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "TypeScript configuration for ESLint 9",
5
5
  "keywords": [
6
6
  "JavaScript TypeScript Style",
@@ -51,7 +51,7 @@
51
51
  "test": "mocha test --recursive --verbose --color"
52
52
  },
53
53
  "dependencies": {
54
- "@sequencemedia/eslint-merge": "^0.0.2",
54
+ "@sequencemedia/eslint-merge": "^0.0.4",
55
55
  "eslint-plugin-eslint-comments": "^3.2.0",
56
56
  "eslint-plugin-import": "^2.31.0",
57
57
  "eslint-plugin-n": "^17.14.0",
@@ -60,7 +60,7 @@
60
60
  "typescript-eslint": "^8.17.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@sequencemedia/eslint-config-standard": "^0.1.5",
63
+ "@sequencemedia/eslint-config-standard": "^0.1.7",
64
64
  "chai": "^5.1.2",
65
65
  "eslint": "^9.16.0",
66
66
  "husky": "^9.1.7",
@@ -72,6 +72,7 @@
72
72
  "imports": {
73
73
  "#eslint-config-typescript": "./index.mjs",
74
74
  "#eslint-config-typescript/common": "./common/index.mjs",
75
+ "#eslint-config-typescript/config": "./config/index.mjs",
75
76
  "#eslint-config-typescript/config/*": "./config/*.mjs",
76
77
  "#eslint-config-typescript/merge": "./merge.mjs",
77
78
  "#eslint-config-typescript/merge/*": "./merge/*.mjs"
@@ -79,6 +80,7 @@
79
80
  "exports": {
80
81
  ".": "./index.mjs",
81
82
  "./common": "./common/index.mjs",
83
+ "./config": "./config/index.mjs",
82
84
  "./config/*": "./config/*.mjs",
83
85
  "./merge": "./merge.mjs",
84
86
  "./merge/*": "./merge/*.mjs"
@@ -0,0 +1,9 @@
1
+ import {
2
+ expect
3
+ } from 'chai'
4
+
5
+ import { typescript } from '@sequencemedia/eslint-config-typescript/config'
6
+
7
+ describe('@sequencemedia/eslint-config-typescript/config', () => {
8
+ describe('`typescript`', () => it('is an object', () => expect(typescript).to.be.an('object')))
9
+ })
package/common/merge.mjs DELETED
@@ -1,82 +0,0 @@
1
- function hasLanguageOptionsParser ({ languageOptions: { parser = null } = {} }) {
2
- return Boolean(parser)
3
- }
4
-
5
- function getLanguageOptionsParser ({ languageOptions: { parser = null } = {} }) {
6
- return parser
7
- }
8
-
9
- function removeParserByEntriesKey ([key]) {
10
- return key !== 'parser'
11
- }
12
-
13
- export function getLanguageOptionsWithoutParser ({ languageOptions = {} }) {
14
- const entries = Object.entries(languageOptions)
15
-
16
- return (
17
- Object.fromEntries(
18
- entries.filter(removeParserByEntriesKey)
19
- )
20
- )
21
- }
22
-
23
- export function getLanguageOptions ({ languageOptions = {} }) {
24
- return languageOptions
25
- }
26
-
27
- export function getLinterOptions ({ linterOptions = {} }) {
28
- return linterOptions
29
- }
30
-
31
- export function getProcessor ({ processor = {} }) {
32
- return processor
33
- }
34
-
35
- export function getRules ({ rules = {} }) {
36
- return rules
37
- }
38
-
39
- export function getSettings ({ settings = {} }) {
40
- return settings
41
- }
42
-
43
- export function mergeLanguageOptions (alpha = {}, omega = {}) {
44
- return (
45
- Object
46
- .assign(
47
- hasLanguageOptionsParser(alpha) ? { parser: getLanguageOptionsParser(alpha) } : {},
48
- structuredClone(getLanguageOptionsWithoutParser(alpha)),
49
- getLanguageOptions(omega)
50
- )
51
- )
52
- }
53
-
54
- export function mergeLinterOptions (alpha = {}, omega = {}) {
55
- return (
56
- Object
57
- .assign(
58
- structuredClone(getLinterOptions(alpha)),
59
- getLinterOptions(omega)
60
- )
61
- )
62
- }
63
-
64
- export function mergeRules (alpha = {}, omega = {}) {
65
- return (
66
- Object
67
- .assign(
68
- structuredClone(getRules(alpha)),
69
- getRules(omega)
70
- )
71
- )
72
- }
73
-
74
- export function mergeSettings (alpha = {}, omega = {}) {
75
- return (
76
- Object
77
- .assign(
78
- structuredClone(getSettings(alpha)),
79
- getSettings(omega)
80
- )
81
- )
82
- }