Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

feat: add plugin meta and support typescript-eslint@7 #86

Merged
merged 5 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 10 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"semantic-release": "semantic-release"
},
"dependencies": {
"@typescript-eslint/utils": "^6.0.0",
"@typescript-eslint/utils": "^6.0.0 || ^7.0.0",
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
"tslib": "^2.3.1",
"tsutils": "^3.21.0"
"ts-api-utils": "^1.3.0"
},
"peerDependencies": {
"eslint": "^7.0.0 || ^8.0.0",
Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import * as rules from './rules';
import * as configs from './configs';

export { configs, rules };
const packageData = require('../package.json') as Record<string, string>;
const meta = { name: packageData.name, version: packageData.version };

export { configs, meta, rules };
6 changes: 5 additions & 1 deletion src/rules/deprecation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
TSESLint,
TSESTree,
} from '@typescript-eslint/utils';
import { isReassignmentTarget } from 'tsutils';
import { AccessKind, getAccessKind } from 'ts-api-utils';
import * as ts from 'typescript';
import { stringifyJSDocTagInfoText } from '../utils/stringifyJSDocTagInfoText';

Expand Down Expand Up @@ -333,6 +333,10 @@ function isFunction(symbol: ts.Symbol) {
}
}

function isReassignmentTarget(node: ts.Expression): boolean {
return (getAccessKind(node) & AccessKind.Write) !== 0;
}

function isPropertyAssignment(node: ts.Node): node is ts.PropertyAssignment {
return node.kind === ts.SyntaxKind.PropertyAssignment;
}
Expand Down