@lsby/eslint-plugin 0.0.12 → 0.0.13

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.
@@ -13,14 +13,13 @@ module.exports = {
13
13
  create(context) {
14
14
  return {
15
15
  VariableDeclaration(node) {
16
+ // 跳过 unique symbol
16
17
  if ((node.kind === 'const' || node.kind === 'var') && !node.declare) {
17
- // 避免 unique symbol 类型
18
- const hasUniqueSymbol = node.declarations.some(
19
- (decl) => decl.id.typeAnnotation?.typeAnnotation.type === 'TSUniqueKeyword',
20
- )
21
- if (hasUniqueSymbol) {
22
- return // 跳过 unique symbol
23
- }
18
+ let hasUniqueSymbol = node.declarations.some((decl) => {
19
+ const typeAnn = decl.id.typeAnnotation?.typeAnnotation
20
+ return typeAnn?.type === 'TSTypeOperator' && typeAnn.operator === 'unique'
21
+ })
22
+ if (hasUniqueSymbol) return
24
23
 
25
24
  // 使用修复功能将 const 或 var 替换为 let
26
25
  context.report({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsby/eslint-plugin",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "pub:public": "bumpp && npm publish --access public",