@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.
@@ -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 && node.value.type === 'TSEmptyBodyFunctionExpression'
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 (!match || match.index === undefined) return null
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 (!docMatch || docMatch.index === undefined) return null
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 (!option || option.blankLine !== 'always') continue
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 || !node.range) return false
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)
@@ -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': 0, // buggy
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.54.2",
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": "0.23.0",
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
  [![npm](https://img.shields.io/npm/v/@naturalcycles/dev-lib/latest.svg)](https://www.npmjs.com/package/@naturalcycles/dev-lib)
7
7
  [![install size](https://packagephobia.now.sh/badge?p=@naturalcycles/dev-lib)](https://packagephobia.now.sh/result?p=@naturalcycles/dev-lib)
8
- [![Maintainability](https://api.codeclimate.com/v1/badges/7df5e4dc0514ff142b7b/maintainability)](https://codeclimate.com/github/NaturalCycles/dev-lib/maintainability)
9
- [![Test Coverage](https://api.codeclimate.com/v1/badges/7df5e4dc0514ff142b7b/test_coverage)](https://codeclimate.com/github/NaturalCycles/dev-lib/test_coverage)
10
8
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
11
- [![Known Vulnerabilities](https://snyk.io/package/npm/snyk/badge.svg)](https://snyk.io/package/npm/@naturalcycles/dev-lib)
12
- [![Actions](https://github.com/NaturalCycles/dev-lib/workflows/default/badge.svg)](https://github.com/NaturalCycles/dev-lib/actions)
13
9
 
14
10
  ## Tools that dev-lib enables
15
11