Skip to content

Commit

Permalink
refactor(config): remove compatibility with TSLint
Browse files Browse the repository at this point in the history
close #4
  • Loading branch information
johnsoncodehk committed Jan 3, 2024
1 parent e56860d commit ee13f8f
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 207 deletions.
27 changes: 1 addition & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ The performance of TypeScript in code editors has always been a crucial concern.

However, for complex types or large codebases, the tsserver process can consume significant memory and CPU resources. When linter tools integrate with TypeScript and create their own LanguageService instances, memory and CPU usage can continue to increase. In some cases, this has caused projects to experience long save times when codeActionOnSave is enabled in VSCode.

TSSLint aims to seamlessly integrate with tsserver to minimize unnecessary overhead and provide linting capabilities on top of it. It also supports reusing TSLint rules to reduce duplication of work.
TSSLint aims to seamlessly integrate with tsserver to minimize unnecessary overhead and provide linting capabilities on top of it.

## Features

- Integration with tsserver to minimize semantic linting overhead in IDEs
- Compatibility with TSLint rules
- Writing config in typescript
- Direct support for meta framework files based on TS Plugin without a parser (e.g., Vue)

Expand Down Expand Up @@ -134,27 +133,3 @@ export default defineConfig({
],
});
```

## Using TSLint Rules

TSSLint supports the reuse of TSLint rules. This feature allows you to avoid duplicating work when you want to use existing TSLint rules. To use TSLint rules, you need to parse them using the `parseTSLintRules` function from `@tsslint/config` as shown in the example below:

```typescript
import { defineConfig, parseTSLintRules } from '@tsslint/config';

export default defineConfig({
rules: {
...parseTSLintRules([
new (require('tslint/lib/rules/banTsIgnoreRule').Rule)({
ruleName: 'ban-ts-ignore',
ruleArguments: [],
ruleSeverity: 'warning',
}),
]),
},
});
```

In the above example, the `ban-ts-ignore` rule from TSLint is being used. The `parseTSLintRules` function takes an array of TSLint rules and returns an object that can be spread into the `rules` property of the config object passed to `defineConfig`.

Please refer to the `fixtures/parse-tslint-rules/` file for a complete example.
2 changes: 0 additions & 2 deletions fixtures/parse-tslint-rules/fixture.ts

This file was deleted.

3 changes: 0 additions & 3 deletions fixtures/parse-tslint-rules/tsconfig.json

This file was deleted.

9 changes: 0 additions & 9 deletions fixtures/parse-tslint-rules/tsslint.config.ts

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"@lerna-lite/publish": "latest",
"@tsslint/config": "0.0.8",
"@types/node": "latest",
"tslint": "latest",
"typescript": "latest"
},
"version": "0.0.8"
Expand Down
1 change: 0 additions & 1 deletion packages/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from './lib/build';
export * from './lib/watch';
export * from './lib/tslint';
export * from './lib/types';

import type { Config } from './lib/types';
Expand Down
55 changes: 0 additions & 55 deletions packages/config/lib/tslint.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,5 @@
},
"dependencies": {
"esbuild": "^0.19.0"
},
"devDependencies": {
"tslint": "latest"
}
}
107 changes: 0 additions & 107 deletions pnpm-lock.yaml

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

0 comments on commit ee13f8f

Please sign in to comment.