@sequencemedia/eslint-config-typescript 0.1.4 → 0.1.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.
- package/README.md +12 -10
- package/package.json +5 -6
- package/common/index.mjs +0 -10
- package/test/common/index.spec.mjs +0 -34
- package/test/configs/index.spec.mjs +0 -14
- package/test/configs/recommended/merge.spec.mjs +0 -88
- package/test/configs/recommended.spec.mjs +0 -9
- package/test/configs/typescript/merge.spec.mjs +0 -88
- package/test/configs/typescript.spec.mjs +0 -9
- package/test/merge.spec.mjs +0 -96
package/README.md
CHANGED
|
@@ -31,16 +31,18 @@ export default [
|
|
|
31
31
|
You can merge _changes_ in the default configuration using the `merge` utility:
|
|
32
32
|
|
|
33
33
|
```javascript
|
|
34
|
-
import merge from '@sequencemedia/eslint-config-typescript/merge'
|
|
35
|
-
|
|
36
|
-
export default
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
import merge from '@sequencemedia/eslint-config-typescript/configs/recommended/merge'
|
|
35
|
+
|
|
36
|
+
export default (
|
|
37
|
+
merge({
|
|
38
|
+
files: [
|
|
39
|
+
'**/*.{mjs,cjs}'
|
|
40
|
+
],
|
|
41
|
+
ignores: [
|
|
42
|
+
'lib'
|
|
43
|
+
]
|
|
44
|
+
})
|
|
45
|
+
)
|
|
44
46
|
```
|
|
45
47
|
|
|
46
48
|
Which is _equivalent to_:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequencemedia/eslint-config-typescript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "TypeScript configuration for ESLint 9",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"JavaScript TypeScript Style",
|
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@sequencemedia/eslint-merge": "^0.0.4",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
56
|
-
"@typescript-eslint/parser": "^8.
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^8.18.0",
|
|
56
|
+
"@typescript-eslint/parser": "^8.18.0",
|
|
57
57
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
58
58
|
"eslint-plugin-import": "^2.31.0",
|
|
59
|
-
"eslint-plugin-n": "^17.
|
|
59
|
+
"eslint-plugin-n": "^17.15.0",
|
|
60
60
|
"eslint-plugin-promise": "^7.2.1",
|
|
61
61
|
"globals": "^15.13.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@sequencemedia/eslint-config-standard": "^0.2.
|
|
64
|
+
"@sequencemedia/eslint-config-standard": "^0.2.6",
|
|
65
65
|
"chai": "^5.1.2",
|
|
66
66
|
"eslint": "^9.16.0",
|
|
67
67
|
"husky": "^9.1.7",
|
|
@@ -72,7 +72,6 @@
|
|
|
72
72
|
},
|
|
73
73
|
"imports": {
|
|
74
74
|
"#eslint-config-typescript": "./index.mjs",
|
|
75
|
-
"#eslint-config-typescript/common": "./common/index.mjs",
|
|
76
75
|
"#eslint-config-typescript/configs": "./configs/index.mjs",
|
|
77
76
|
"#eslint-config-typescript/configs/*": "./configs/*.mjs",
|
|
78
77
|
"#eslint-config-typescript/merge": "./merge.mjs"
|
package/common/index.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
expect
|
|
3
|
-
} from 'chai'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
isString,
|
|
7
|
-
isObject
|
|
8
|
-
} from '#eslint-config-typescript/common'
|
|
9
|
-
|
|
10
|
-
describe('#eslint-config-typescript/common', () => {
|
|
11
|
-
describe('`isString`', () => it('is a function', () => expect(isString).to.be.a('function')))
|
|
12
|
-
|
|
13
|
-
describe('`isObject`', () => it('is a function', () => expect(isObject).to.be.a('function')))
|
|
14
|
-
|
|
15
|
-
describe('`isString()`', () => {
|
|
16
|
-
describe('argument is a string', () => it('returns true', () => expect(isString('')).to.true))
|
|
17
|
-
describe('argument is a number', () => it('returns false', () => expect(isString(1)).to.be.false))
|
|
18
|
-
describe('argument is null', () => it('returns false', () => expect(isString(null)).to.be.false))
|
|
19
|
-
describe('argument is undefined', () => it('returns false', () => expect(isString()).to.be.false))
|
|
20
|
-
describe('argument is a boolean', () => it('returns false', () => expect(isString(true)).to.be.false))
|
|
21
|
-
describe('argument is an object', () => it('returns false', () => expect(isString({})).to.be.false))
|
|
22
|
-
describe('argument is an array', () => it('returns false', () => expect(isString([])).to.be.false))
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
describe('`isObject()`', () => {
|
|
26
|
-
describe('argument is a string', () => it('returns false', () => expect(isObject('')).to.false))
|
|
27
|
-
describe('argument is a number', () => it('returns false', () => expect(isObject(1)).to.be.false))
|
|
28
|
-
describe('argument is null', () => it('returns false', () => expect(isObject(null)).to.be.false))
|
|
29
|
-
describe('argument is undefined', () => it('returns false', () => expect(isObject()).to.be.false))
|
|
30
|
-
describe('argument is a boolean', () => it('returns false', () => expect(isObject(true)).to.be.false))
|
|
31
|
-
describe('argument is an object', () => it('returns true', () => expect(isObject({})).to.be.true))
|
|
32
|
-
describe('argument is an array', () => it('returns false', () => expect(isObject([])).to.be.false))
|
|
33
|
-
})
|
|
34
|
-
})
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
expect
|
|
3
|
-
} from 'chai'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
recommended,
|
|
7
|
-
typescript
|
|
8
|
-
} from '@sequencemedia/eslint-config-typescript/configs'
|
|
9
|
-
|
|
10
|
-
describe('@sequencemedia/eslint-config-typescript/configs', () => {
|
|
11
|
-
describe('`recommended`', () => it('is an object', () => expect(recommended).to.be.an('object')))
|
|
12
|
-
|
|
13
|
-
describe('`typescript`', () => it('is an object', () => expect(typescript).to.be.an('object')))
|
|
14
|
-
})
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
expect
|
|
3
|
-
} from 'chai'
|
|
4
|
-
|
|
5
|
-
import RECOMMENDED from '@sequencemedia/eslint-config-typescript/configs/recommended'
|
|
6
|
-
|
|
7
|
-
import merge from '@sequencemedia/eslint-config-typescript/configs/recommended/merge'
|
|
8
|
-
|
|
9
|
-
describe('@sequencemedia/eslint-config-typescript/configs/recommended/merge', () => {
|
|
10
|
-
describe('`merge`', () => it('is a function', () => expect(merge).to.be.a('function')))
|
|
11
|
-
|
|
12
|
-
describe('`merge()`', () => {
|
|
13
|
-
describe('Always', () => it('returns an object', () => expect(merge()).to.be.an('object')))
|
|
14
|
-
|
|
15
|
-
describe('Merges', () => {
|
|
16
|
-
it('returns an object', () => {
|
|
17
|
-
const MOCK_FILES = [
|
|
18
|
-
'MOCK FILES'
|
|
19
|
-
]
|
|
20
|
-
const MOCK_IGNORES = [
|
|
21
|
-
'MOCK IGNORES'
|
|
22
|
-
]
|
|
23
|
-
const MOCK_LANGUAGE_OPTIONS = {
|
|
24
|
-
mockOption: 'MOCK LANGUAGE OPTIONS'
|
|
25
|
-
}
|
|
26
|
-
const MOCK_LINTER_OPTIONS = {
|
|
27
|
-
mockOption: 'MOCK LINTER OPTIONS'
|
|
28
|
-
}
|
|
29
|
-
const MOCK_PLUGINS = {
|
|
30
|
-
mockOption: 'MOCK PLUGINS'
|
|
31
|
-
}
|
|
32
|
-
const MOCK_RULES = {
|
|
33
|
-
mockOption: 'MOCK RULES'
|
|
34
|
-
}
|
|
35
|
-
const MOCK_SETTINGS = {
|
|
36
|
-
mockOption: 'MOCK SETTINGS'
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const {
|
|
40
|
-
languageOptions: RECOMMENDED_LANGUAGE_OPTIONS,
|
|
41
|
-
linterOptions: RECOMMENDED_LINTER_OPTIONS,
|
|
42
|
-
plugins: RECOMMENDED_PLUGINS,
|
|
43
|
-
rules: RECOMMENDED_RULES,
|
|
44
|
-
settings: RECOMMENDED_SETTINGS
|
|
45
|
-
} = RECOMMENDED
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
expect(
|
|
49
|
-
merge({
|
|
50
|
-
files: MOCK_FILES,
|
|
51
|
-
ignores: MOCK_IGNORES,
|
|
52
|
-
languageOptions: MOCK_LANGUAGE_OPTIONS,
|
|
53
|
-
linterOptions: MOCK_LINTER_OPTIONS,
|
|
54
|
-
plugins: MOCK_PLUGINS,
|
|
55
|
-
rules: MOCK_RULES,
|
|
56
|
-
settings: MOCK_SETTINGS
|
|
57
|
-
})
|
|
58
|
-
)
|
|
59
|
-
.to.eql({
|
|
60
|
-
...RECOMMENDED,
|
|
61
|
-
files: MOCK_FILES,
|
|
62
|
-
ignores: MOCK_IGNORES,
|
|
63
|
-
languageOptions: {
|
|
64
|
-
...RECOMMENDED_LANGUAGE_OPTIONS,
|
|
65
|
-
...MOCK_LANGUAGE_OPTIONS
|
|
66
|
-
},
|
|
67
|
-
linterOptions: {
|
|
68
|
-
...RECOMMENDED_LINTER_OPTIONS,
|
|
69
|
-
...MOCK_LINTER_OPTIONS
|
|
70
|
-
},
|
|
71
|
-
plugins: {
|
|
72
|
-
...RECOMMENDED_PLUGINS,
|
|
73
|
-
...MOCK_PLUGINS
|
|
74
|
-
},
|
|
75
|
-
rules: {
|
|
76
|
-
...RECOMMENDED_RULES,
|
|
77
|
-
...MOCK_RULES
|
|
78
|
-
},
|
|
79
|
-
settings: {
|
|
80
|
-
...RECOMMENDED_SETTINGS,
|
|
81
|
-
...MOCK_SETTINGS
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
)
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
})
|
|
88
|
-
})
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
expect
|
|
3
|
-
} from 'chai'
|
|
4
|
-
|
|
5
|
-
import recommended from '@sequencemedia/eslint-config-typescript/configs/recommended'
|
|
6
|
-
|
|
7
|
-
describe('@sequencemedia/eslint-config-typescript/configs/recommended', () => {
|
|
8
|
-
describe('`recommended`', () => it('is an object', () => expect(recommended).to.be.an('object')))
|
|
9
|
-
})
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
expect
|
|
3
|
-
} from 'chai'
|
|
4
|
-
|
|
5
|
-
import TYPESCRIPT from '@sequencemedia/eslint-config-typescript/configs/typescript'
|
|
6
|
-
|
|
7
|
-
import merge from '@sequencemedia/eslint-config-typescript/configs/typescript/merge'
|
|
8
|
-
|
|
9
|
-
describe('@sequencemedia/eslint-config-typescript/configs/typescript/merge', () => {
|
|
10
|
-
describe('`merge`', () => it('is a function', () => expect(merge).to.be.a('function')))
|
|
11
|
-
|
|
12
|
-
describe('`merge()`', () => {
|
|
13
|
-
describe('Always', () => it('returns an object', () => expect(merge()).to.be.an('object')))
|
|
14
|
-
|
|
15
|
-
describe('Merges', () => {
|
|
16
|
-
it('returns an object', () => {
|
|
17
|
-
const MOCK_FILES = [
|
|
18
|
-
'MOCK FILES'
|
|
19
|
-
]
|
|
20
|
-
const MOCK_IGNORES = [
|
|
21
|
-
'MOCK IGNORES'
|
|
22
|
-
]
|
|
23
|
-
const MOCK_LANGUAGE_OPTIONS = {
|
|
24
|
-
mockOption: 'MOCK LANGUAGE OPTIONS'
|
|
25
|
-
}
|
|
26
|
-
const MOCK_LINTER_OPTIONS = {
|
|
27
|
-
mockOption: 'MOCK LINTER OPTIONS'
|
|
28
|
-
}
|
|
29
|
-
const MOCK_PLUGINS = {
|
|
30
|
-
mockOption: 'MOCK PLUGINS'
|
|
31
|
-
}
|
|
32
|
-
const MOCK_RULES = {
|
|
33
|
-
mockOption: 'MOCK RULES'
|
|
34
|
-
}
|
|
35
|
-
const MOCK_SETTINGS = {
|
|
36
|
-
mockOption: 'MOCK SETTINGS'
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const {
|
|
40
|
-
languageOptions: TYPESCRIPT_LANGUAGE_OPTIONS,
|
|
41
|
-
linterOptions: TYPESCRIPT_LINTER_OPTIONS,
|
|
42
|
-
plugins: TYPESCRIPT_PLUGINS,
|
|
43
|
-
rules: TYPESCRIPT_RULES,
|
|
44
|
-
settings: TYPESCRIPT_SETTINGS
|
|
45
|
-
} = TYPESCRIPT
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
expect(
|
|
49
|
-
merge({
|
|
50
|
-
files: MOCK_FILES,
|
|
51
|
-
ignores: MOCK_IGNORES,
|
|
52
|
-
languageOptions: MOCK_LANGUAGE_OPTIONS,
|
|
53
|
-
linterOptions: MOCK_LINTER_OPTIONS,
|
|
54
|
-
plugins: MOCK_PLUGINS,
|
|
55
|
-
rules: MOCK_RULES,
|
|
56
|
-
settings: MOCK_SETTINGS
|
|
57
|
-
})
|
|
58
|
-
)
|
|
59
|
-
.to.eql({
|
|
60
|
-
...TYPESCRIPT,
|
|
61
|
-
files: MOCK_FILES,
|
|
62
|
-
ignores: MOCK_IGNORES,
|
|
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
|
-
},
|
|
75
|
-
rules: {
|
|
76
|
-
...TYPESCRIPT_RULES,
|
|
77
|
-
...MOCK_RULES
|
|
78
|
-
},
|
|
79
|
-
settings: {
|
|
80
|
-
...TYPESCRIPT_SETTINGS,
|
|
81
|
-
...MOCK_SETTINGS
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
)
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
})
|
|
88
|
-
})
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
expect
|
|
3
|
-
} from 'chai'
|
|
4
|
-
|
|
5
|
-
import typescript from '@sequencemedia/eslint-config-typescript/configs/typescript'
|
|
6
|
-
|
|
7
|
-
describe('@sequencemedia/eslint-config-typescript/configs/typescript', () => {
|
|
8
|
-
describe('`typescript`', () => it('is an object', () => expect(typescript).to.be.an('object')))
|
|
9
|
-
})
|
package/test/merge.spec.mjs
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
expect
|
|
3
|
-
} from 'chai'
|
|
4
|
-
|
|
5
|
-
import eslintConfig from '@sequencemedia/eslint-config-typescript'
|
|
6
|
-
|
|
7
|
-
import merge from '@sequencemedia/eslint-config-typescript/merge'
|
|
8
|
-
|
|
9
|
-
describe('@sequencemedia/eslint-config-typescript/merge', () => {
|
|
10
|
-
describe('`merge`', () => it('is a function', () => expect(merge).to.be.a('function')))
|
|
11
|
-
|
|
12
|
-
describe('`merge()`', () => {
|
|
13
|
-
describe('Always', () => it('returns an array', () => expect(merge()).to.be.an('array')))
|
|
14
|
-
|
|
15
|
-
describe('Merges', () => {
|
|
16
|
-
const [
|
|
17
|
-
DEFAULT,
|
|
18
|
-
TYPESCRIPT
|
|
19
|
-
] = eslintConfig
|
|
20
|
-
|
|
21
|
-
it('returns an array', () => {
|
|
22
|
-
const MOCK_FILES = [
|
|
23
|
-
'MOCK FILES'
|
|
24
|
-
]
|
|
25
|
-
const MOCK_IGNORES = [
|
|
26
|
-
'MOCK IGNORES'
|
|
27
|
-
]
|
|
28
|
-
const MOCK_LANGUAGE_OPTIONS = {
|
|
29
|
-
mockOption: 'MOCK LANGUAGE OPTIONS'
|
|
30
|
-
}
|
|
31
|
-
const MOCK_LINTER_OPTIONS = {
|
|
32
|
-
mockOption: 'MOCK LINTER OPTIONS'
|
|
33
|
-
}
|
|
34
|
-
const MOCK_PLUGINS = {
|
|
35
|
-
mockOption: 'MOCK PLUGINS'
|
|
36
|
-
}
|
|
37
|
-
const MOCK_RULES = {
|
|
38
|
-
mockOption: 'MOCK RULES'
|
|
39
|
-
}
|
|
40
|
-
const MOCK_SETTINGS = {
|
|
41
|
-
mockOption: 'MOCK SETTINGS'
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const {
|
|
45
|
-
languageOptions: TYPESCRIPT_LANGUAGE_OPTIONS,
|
|
46
|
-
linterOptions: TYPESCRIPT_LINTER_OPTIONS,
|
|
47
|
-
plugins: TYPESCRIPT_PLUGINS,
|
|
48
|
-
rules: TYPESCRIPT_RULES,
|
|
49
|
-
settings: TYPESCRIPT_SETTINGS
|
|
50
|
-
} = TYPESCRIPT
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
expect(
|
|
54
|
-
merge({
|
|
55
|
-
files: MOCK_FILES,
|
|
56
|
-
ignores: MOCK_IGNORES,
|
|
57
|
-
languageOptions: MOCK_LANGUAGE_OPTIONS,
|
|
58
|
-
linterOptions: MOCK_LINTER_OPTIONS,
|
|
59
|
-
plugins: MOCK_PLUGINS,
|
|
60
|
-
rules: MOCK_RULES,
|
|
61
|
-
settings: MOCK_SETTINGS
|
|
62
|
-
})
|
|
63
|
-
)
|
|
64
|
-
.to.eql([
|
|
65
|
-
DEFAULT,
|
|
66
|
-
{
|
|
67
|
-
...TYPESCRIPT,
|
|
68
|
-
files: MOCK_FILES,
|
|
69
|
-
ignores: MOCK_IGNORES,
|
|
70
|
-
languageOptions: {
|
|
71
|
-
...TYPESCRIPT_LANGUAGE_OPTIONS,
|
|
72
|
-
...MOCK_LANGUAGE_OPTIONS
|
|
73
|
-
},
|
|
74
|
-
linterOptions: {
|
|
75
|
-
...TYPESCRIPT_LINTER_OPTIONS,
|
|
76
|
-
...MOCK_LINTER_OPTIONS
|
|
77
|
-
},
|
|
78
|
-
plugins: {
|
|
79
|
-
...TYPESCRIPT_PLUGINS,
|
|
80
|
-
...MOCK_PLUGINS
|
|
81
|
-
},
|
|
82
|
-
rules: {
|
|
83
|
-
...TYPESCRIPT_RULES,
|
|
84
|
-
...MOCK_RULES
|
|
85
|
-
},
|
|
86
|
-
settings: {
|
|
87
|
-
...TYPESCRIPT_SETTINGS,
|
|
88
|
-
...MOCK_SETTINGS
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
])
|
|
92
|
-
)
|
|
93
|
-
})
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
})
|