Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
mws-tslint-rules
Advanced tools
Readme
A set of custom TSLint rules.
Install from npm to your devDependencies:
npm install --save-dev mws-tslint-rules
Configure tslint to use the mws-tslint-rules folder:
Add the following path to the rulesDirectory
setting in your tslint.json
file:
{
"rulesDirectory": [
"node_modules/mws-tslint-rules/dist"
],
"rules": {
...
}
}
Now configure some of the new rules.
empty-line-before-return-statement
TODO
TODO
{
"empty-line-before-return-statement": true
}
Not configurable.
empty-lines-at-block-statement
TODO
TODO
{
"empty-lines-at-block-statement": true
}
Not configurable.
empty-lines-at-variable-statement
TODO
TODO
{
"empty-lines-at-variable-statement": true
}
Not configurable.
ext-variable-name
This rule provides extensive support for customizing allowable variable names for a wide variety of variable tags. The rule is configured by setting up a list of sub-rules that specify the tags of variables to check and the checks to perform on the variable"s name. The sub-rules are checked in order and the first one that matches the tags of variable being checked is the only one that is used.
An example set of sub-rules for an example coding standard is shown below.
{
"ext-variable-name": [
true,
[
"class",
"pascal"
],
[
"interface",
"pascal",
{
"regex": "^I.*$"
}
],
[
"parameter",
"camel"
],
[
"property",
"static",
"camel",
{
"regex": "^s.*$"
}
],
[
"property",
"private",
"camel",
"allow-leading-underscore"
],
[
"property",
"protected",
"camel",
"allow-leading-underscore"
],
[
"variable",
"local",
"snake"
],
[
"variable",
"const",
"upper"
],
[
"variable",
"camel",
{
"regex": "^g.*$"
}
],
[
"method",
"private",
"camel",
"allow-leading-underscore"
],
[
"method",
"protected",
"camel",
"allow-leading-underscore"
],
[
"function",
"camel"
],
[
"default",
"camel"
]
]
}
Allowed tags for variables:
note: If any tags is added to a sub-rule then all must match the variable.
Checks allowed:
sorting-import
TODO
TODO
{
"sorting-import": [
true,
{
"orderImportType": ["NAMED", "SIDE_EFFECT", "NAMESPACE", "NAMED_WITHOUT_BRACKETS", "EQUALS"],
"orderSortingType": "MAX_TO_MIN_LENGTH"
}
]
}
For orderImportType
, array of all the following in desired order:
"NAMED"
-"SIDE_EFFECT"
-"NAMESPACE"
-"NAMED_WITHOUT_BRACKETS"
-"EQUALS"
-For orderSortingType
, one of the following:
"MAX_TO_MIN_LENGTH"
-"MIN_TO_MAX_LENGTH"
-types-in-method-declaration
TODO
TODO
{
"types-in-method-declaration": true
}
Not configurable.
whitespace-in-method-declaration
TODO
TODO
{
"whitespace-in-method-declaration": true
}
Not configurable.
Issue reports and pull requests are highly welcome! Please make sure to provide sensible tests along with your pull request.
To get started with development, clone the project and run npm install
.
To run the tests execute npm test
.
FAQs
Custom set of TSLint rules
The npm package mws-tslint-rules receives a total of 1 weekly downloads. As such, mws-tslint-rules popularity was classified as not popular.
We found that mws-tslint-rules demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.