Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
cs-tslint-rules
Advanced tools
This repo contains the TSLint rule configuration for Code School projects that use TypeScript as well as TypeScript + Angular 2.
The instructions differ for plain TypeScript projects and for Angular 2 + TypeScript projects, so follow the instructions that apply to your project type.
Install TSLint and TypeScript for your project.
npm i --save-dev typescript tslint
Install the cs-tslint-rules module.
npm i --save-dev cs-tslint-rules
Create a tslint.json
file in the root folder of your project and add
the following:
{
"rulesDirectory": [
"node_modules/tslint-eslint-rules/dist/rules",
"node_modules/vrsource-tslint-rules/rules"
],
"extends": "cs-tslint-rules/tslint-base"
}
Install TSLint, Codelyzer and TypeScript for your project.
npm i --save-dev typescript tslint codelyzer
Install the cs-tslint-rules module.
npm i --save-dev cs-tslint-rules
Create a tslint.json
file in the root folder of your project and add
the following:
{
"rulesDirectory": [
"node_modules/codelyzer",
"node_modules/tslint-eslint-rules/dist/rules",
"node_modules/vrsource-tslint-rules/rules"
],
"extends": "cs-tslint-rules/tslint-ng2"
}
Add a script to the scripts
section of your package.json
, making sure to
set the correct pattern for your source files (the example uses src/**/*.ts
):
{
"scripts": {
"lint": "tslint --type-check --fix --project tsconfig.json --config tslint.json src/**/*.ts"
}
}
If you have a build script then you should modify it so that the linting is done before the project can be successfully built. For example, you could prepend the linting command to your build command to make sure the linting is run first.
npm run lint
The TSLint configuration in this module pair well with the following
compilerOptions
added to your tsconfig.json
as an extra layer of
best practice enforcement:
{
"compilerOptions": {
"strict": true,
"noUnusedLocals": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noEmitOnError": true
}
}
[v9.0.0] - 2017-08-28
tslint-ng2.json
no-any
rule as it is nearly impossible to enforce without making exceptionsmax-classes-per-file
ruleban
rule to [ true, [ "window", "isNaN", "describe.only", "it.only" ] ]
ban
rule optionsFAQs
The TSLint rules for Code School's TypeScript conventions.
The npm package cs-tslint-rules receives a total of 2 weekly downloads. As such, cs-tslint-rules popularity was classified as not popular.
We found that cs-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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.