Hey,
I’m adding support for TSLint, and it turns out that the code is basically exactly the same as for ESLint.
--- src/special/eslint.js 2018-08-09 13:33:55.000000000 +0100
+++ src/special/tslint.js 2018-08-09 13:45:28.000000000 +0100
@@ -101,10 +101,10 @@
function checkConfig(config, rootDir) {
const parser = wrapToArray(config.parser);
- const plugins = wrapToArray(config.plugins).map(plugin => `eslint-plugin-${plugin}`);
+ const plugins = wrapToArray(config.plugins).map(plugin => `tslint-plugin-${plugin}`);
const presets = wrapToArray(config.extends)
- .filter(preset => preset !== 'eslint:recommended')
+ .filter(preset => preset !== 'tslint:recommended')
.map(preset => resolvePresetPackage(preset, rootDir));
const presetPackages = presets
@@ -120,9 +120,9 @@
return lodash.union(parser, plugins, presetPackages, presetDeps);
}
-export default function parseESLint(content, filename, deps, rootDir) {
+export default function parseTSLint(content, filename, deps, rootDir) {
const basename = path.basename(filename);
- if (/^\.eslintrc(\.json|\.js|\.yml|\.yaml)?$/.test(basename)) {
+ if (/^\.tslintrc(\.json|\.js|\.yml|\.yaml)?$/.test(basename)) {
const config = parse(content);
return checkConfig(config, rootDir);
}
How would you prefer this to be done?
- Keep as two files with basically the same content
- Extract the code out to e.g.
src/util/linters.js
and just have a basic call inspecials/*.js
- Just have eslint also check for tslint files/packages
Cheers 🍻
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
TSLint - Palantir Open Source
TSLint is an extensible static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors. It is widely supported ...
Read more >TSLint - npm
TSLint is an extensible static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors.
Read more >TSLint - An extensible linter for the TypeScript language - GitHub
TSLint is an extensible static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors. It is widely supported ...
Read more >TSLint - Visual Studio Marketplace
The implementation as a TypeScript server plugin enables sharing the program representation with TypeScript. This is more efficient than the ...
Read more >Linting TypeScript with Tslint | Mashup Garage Playbook
Tslint is a tool that checks your JavaScript code for errors and code formatting issues. We encourage all projects to adopt the tslint:recommended ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Go for option 2 then, less code we have the better 😃
Fixed in #266, #270 😃