buzinas / tslint-eslint-rules Goto Github PK
View Code? Open in Web Editor NEWImprove your TSLint with the missing ESLint rules
License: MIT License
Improve your TSLint with the missing ESLint rules
License: MIT License
The following causes a linting error when no-ex-assign
is set to true
(line 4, column 12):
class MyClass {}
interface IMyInterface {
myVar: MyClass;
}
The following causes a linting error if no-constant-condition
is true
:
if (!myVar) {
}
Removing the negation removes the linting error:
if (myVar) {
}
Find the first recommended ESLint rule that is missing in TSLint.
We should have a CHANGELOG.md file to add all the release notes.
Also, we should have some commit conventions for better readability of our change history.
We must create a Github release everytime I release a new npm package.
error (no-ex-assign) bootstrap.ts[34, 22]: invalid typeof comparison value
The line in question:
export function bootstrapComponents(): void {
"use strict";
bootstrap((aurelia: Aurelia) => { // this is line 34
aurelia.use
.defaultBindingLanguage()
.defaultResources()
.developmentLogging();
aurelia.start().then(() => aurelia.enhance({}, document.body));
});
}
For one, the rule shouldn't apply here. Also, the error message doesn't match the rule description.
In #1 we've checked all the recommended ESLint rules, now it's time to check all the others.
According to palantir/tslint#790, we can safely upgrade our dependency to the next TSLint stable version.
The README seems like it could use a little bit of updating in that regard. An example is ESLint's strict
is use-strict
in TSLint. Glancing through the rules, there's about 6 or so of these.
We must lint our project, so we have a well-defined style-guide.
tslint.json
fileWe're gonna need this for our projects, and tslint can also benefits from this (palantir/tslint#1044).
We must improve our tests in a way to see how many TSLint failures we have.
1- improve README to handle all the ESLint recommended rules
2- create missing issues for all the recommended rules
We must have the ability to debug Mocha right inside VSCode, so it's easier to catch why testings are failing.
Also, we should improve our build process to include sourcemaps, so we'll be able to debug our TypeScript source, instead of the transpiled Javascript code.
Update README according to the Atom's linter-tslint new version.
My pull request (AtomLinter/linter-tslint#37) was merged.
Based on the rule/option http://eslint.org/docs/rules/no-redeclare
{
"no-redeclare": [
2,
{
"builtinGlobals": true
}
]
}
I believe the no-ex-assign
rule has the wrong failure string: Incorrect string
The following triggers a linting error when the no-unexpected-multiline
rule is true
:
var a, b, c;
if (a === 4
&& (b === 3 || c === 8)) {
}
Similarly, a multi-line property access triggers this error:
var a;
a
.something();
These examples don't trigger linting errors when tested on the eslint.org demo page.
We're gonna need this to our projects, and tslint can also benefits from this (palantir/tslint#1045.).
There are many functions with the same name, we should rename them.
According to eslint.org's documentation on the no-control-regex
rule (http://eslint.org/docs/rules/no-control-regex), the following should throw a linting error when no-control-regex
is true
:
var pattern1 = /\\x1f/;
However, no error is thrown. The second example in the documentation does cause a linting error, as expected:
var pattern2 = new RegExp("\x1f");
palantir/tslint#1016 (comment)
With the extends
feature, custom rules could be published as tslint-config-X
too. Rules directory will be merged.:
// tslint-eslint-rules -> tslint-config-eslint
// main: tslint.json
{
"rulesDirectory": "./<local rule relative path>",
"rules": {
// Can add default rules value here, and
// disable conflicting core rules if needed.
}
}
๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.