@naturalcycles/dev-lib 20.54.2 → 20.55.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/cfg/oxlint-plugin-stylistic.js +5 -5
- package/cfg/oxlint.config.js +1 -1
- package/package.json +2 -2
- package/readme.md +0 -4
|
@@ -49,7 +49,7 @@ function describeStatement(node) {
|
|
|
49
49
|
function isMethodOverload(node) {
|
|
50
50
|
if (!node) return false
|
|
51
51
|
if (node.type !== 'MethodDefinition' && node.type !== 'TSAbstractMethodDefinition') return false
|
|
52
|
-
return node.value
|
|
52
|
+
return node.value?.type === 'TSEmptyBodyFunctionExpression'
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
function getInsertionTarget(sourceCode, prevNode, nextNode) {
|
|
@@ -86,7 +86,7 @@ function findDecoratorTarget(sourceCode, prevNode, nextNode) {
|
|
|
86
86
|
const segment = sourceCode.text.slice(prevNode.range[1], nextNode.range[0])
|
|
87
87
|
const decoratorRegex = /(?:^|\n)([ \t]*@)/
|
|
88
88
|
const match = decoratorRegex.exec(segment)
|
|
89
|
-
if (
|
|
89
|
+
if (match?.index === undefined) return null
|
|
90
90
|
|
|
91
91
|
const relative = match.index + match[0].length - match[1].length
|
|
92
92
|
const absolute = prevNode.range[1] + relative
|
|
@@ -98,7 +98,7 @@ function findDocCommentBeforeIndex(sourceCode, prevNode, targetStart) {
|
|
|
98
98
|
|
|
99
99
|
const slice = sourceCode.text.slice(prevNode.range[1], targetStart)
|
|
100
100
|
const docMatch = slice.match(/(\/\*\*[\s\S]*?\*\/)([ \t]*\r?\n[ \t]*)?$/)
|
|
101
|
-
if (
|
|
101
|
+
if (docMatch?.index === undefined) return null
|
|
102
102
|
|
|
103
103
|
const commentStart = prevNode.range[1] + docMatch.index
|
|
104
104
|
return { range: [commentStart, commentStart], loc: null }
|
|
@@ -180,7 +180,7 @@ const paddingLineBetweenStatementsRule = {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
for (const option of options) {
|
|
183
|
-
if (
|
|
183
|
+
if (option?.blankLine !== 'always') continue
|
|
184
184
|
|
|
185
185
|
if (matchesSelector(option.prev, 'function') && matchesSelector(option.next, '*')) {
|
|
186
186
|
requiresBlankLine.afterFunction = true
|
|
@@ -271,7 +271,7 @@ const paddingLineBetweenStatementsRule = {
|
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
function isSingleLine(node, sourceCode) {
|
|
274
|
-
if (!node
|
|
274
|
+
if (!node?.range) return false
|
|
275
275
|
const start = sourceCode.getLocFromIndex(node.range[0])
|
|
276
276
|
const endIndex = node.range[1] > node.range[0] ? node.range[1] - 1 : node.range[1]
|
|
277
277
|
const end = sourceCode.getLocFromIndex(endIndex)
|
package/cfg/oxlint.config.js
CHANGED
|
@@ -192,7 +192,7 @@ export const sharedConfig = {
|
|
|
192
192
|
'typescript/no-unnecessary-type-constraint': 2,
|
|
193
193
|
// "typescript/no-unsafe-argument": 2, // looks good, but too strict for now
|
|
194
194
|
// "typescript/no-dynamic-delete": 2,
|
|
195
|
-
'typescript/prefer-optional-chain':
|
|
195
|
+
'typescript/prefer-optional-chain': 2,
|
|
196
196
|
'typescript/non-nullable-type-assertion-style': 2,
|
|
197
197
|
'typescript/prefer-literal-enum-member': 2,
|
|
198
198
|
'typescript/prefer-reduce-type-parameter': 2,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/dev-lib",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "20.
|
|
4
|
+
"version": "20.55.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"prompts": "^2",
|
|
7
7
|
"@naturalcycles/js-lib": "^15",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"picomatch": "^4",
|
|
14
14
|
"oxfmt": "^0",
|
|
15
15
|
"oxlint": "^1",
|
|
16
|
-
"oxlint-tsgolint": "
|
|
16
|
+
"oxlint-tsgolint": "^7",
|
|
17
17
|
"semver": "^7",
|
|
18
18
|
"std-env": "^4"
|
|
19
19
|
},
|
package/readme.md
CHANGED
|
@@ -5,11 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
[](https://www.npmjs.com/package/@naturalcycles/dev-lib)
|
|
7
7
|
[](https://packagephobia.now.sh/result?p=@naturalcycles/dev-lib)
|
|
8
|
-
[](https://codeclimate.com/github/NaturalCycles/dev-lib/maintainability)
|
|
9
|
-
[](https://codeclimate.com/github/NaturalCycles/dev-lib/test_coverage)
|
|
10
8
|
[](https://github.com/prettier/prettier)
|
|
11
|
-
[](https://snyk.io/package/npm/@naturalcycles/dev-lib)
|
|
12
|
-
[](https://github.com/NaturalCycles/dev-lib/actions)
|
|
13
9
|
|
|
14
10
|
## Tools that dev-lib enables
|
|
15
11
|
|