Skip to content

Commit f424ff7

Browse files
committed
chore: update tsslint to 2.0.1
1 parent 817d328 commit f424ff7

File tree

4 files changed

+46
-53
lines changed

4 files changed

+46
-53
lines changed

extensions/vscode/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function launch(context: vscode.ExtensionContext) {
155155
},
156156
);
157157

158-
client.onNotification('tsserver/request', async ([seq, command, args]) => {
158+
client.onNotification('tsserver/request', ([seq, command, args]) => {
159159
vscode.commands.executeCommand<{ body: unknown } | undefined>(
160160
'typescript.tsserverRequest',
161161
command,

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"devDependencies": {
2323
"@lerna-lite/cli": "^4.1.2",
2424
"@lerna-lite/publish": "^4.1.2",
25-
"@tsslint/cli": "^1.5.0",
26-
"@tsslint/config": "^1.5.0",
27-
"@tsslint/eslint": "^1.5.0",
25+
"@tsslint/cli": "^2.0.1",
26+
"@tsslint/config": "^2.0.1",
27+
"@tsslint/eslint": "^2.0.1",
2828
"@typescript-eslint/eslint-plugin": "^8.19.0",
2929
"dprint": "^0.50.0",
3030
"oxlint": "^1.0.0",

pnpm-lock.yaml

Lines changed: 32 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsslint.config.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import { defineConfig } from '@tsslint/config';
2-
import { convertRules } from '@tsslint/eslint';
2+
import { defineRules } from '@tsslint/eslint';
33
import * as path from 'node:path';
44

55
export default defineConfig({
66
rules: {
77
semantic: {
8-
...await convertRules({
9-
'@typescript-eslint/consistent-type-imports': ['warn', {
8+
...await defineRules({
9+
'@typescript-eslint/consistent-type-imports': [{
1010
disallowTypeAnnotations: false,
1111
fixStyle: 'inline-type-imports',
1212
}],
13-
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
13+
'@typescript-eslint/no-unnecessary-type-assertion': true,
1414
}),
1515
},
1616
workspace: {
17-
'missing-dependency'({ typescript: ts, sourceFile, reportError, languageServiceHost }) {
18-
const { noEmit } = languageServiceHost.getCompilationSettings();
17+
'missing-dependency'({ typescript: ts, file, program, report }) {
18+
const { noEmit } = program.getCompilerOptions();
1919
if (noEmit) {
2020
return;
2121
}
22-
const packageJsonPath = ts.findConfigFile(sourceFile.fileName, ts.sys.fileExists, 'package.json');
22+
const packageJsonPath = ts.findConfigFile(file.fileName, ts.sys.fileExists, 'package.json');
2323
if (!packageJsonPath) {
2424
return;
2525
}
@@ -35,7 +35,7 @@ export default defineConfig({
3535
const parentPackageJson = !!parentPackageJsonPath && parentPackageJsonPath !== packageJsonPath
3636
? JSON.parse(ts.sys.readFile(parentPackageJsonPath) ?? '')
3737
: {};
38-
ts.forEachChild(sourceFile, function visit(node) {
38+
ts.forEachChild(file, function visit(node) {
3939
if (
4040
ts.isImportDeclaration(node)
4141
&& !node.importClause?.isTypeOnly
@@ -57,9 +57,9 @@ export default defineConfig({
5757
&& !packageJson.dependencies?.[moduleName]
5858
&& !packageJson.peerDependencies?.[moduleName]
5959
) {
60-
reportError(
60+
report(
6161
`Module '${moduleName}' should be in the dependencies.`,
62-
node.getStart(sourceFile),
62+
node.getStart(file),
6363
node.getEnd(),
6464
);
6565
}

0 commit comments

Comments
 (0)