Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Goldberg committed Mar 21, 2018
2 parents d662964 + 307abc4 commit 6d137ca
Show file tree
Hide file tree
Showing 34 changed files with 6,062 additions and 5,506 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ tslint-microsoft-contrib.iml
.npm_cache

out.html
rule-metadata.json
26 changes: 24 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ module.exports = function(grunt) {

tslint: {
options: {
rulesDirectory: 'dist/src'
rulesDirectory: 'dist/src',
formatter: 'verbose'
},
prod: {
options: {
Expand All @@ -240,6 +241,7 @@ module.exports = function(grunt) {
tslintJson.rules['quotemark'] = false;
tslintJson.rules['object-literal-key-quotes'] = false;
tslintJson.rules['max-func-body-length'] = false;
tslintJson.rules['no-implicit-dependencies'] = [true, 'dev'];
return tslintJson;
})()
},
Expand Down Expand Up @@ -313,8 +315,15 @@ module.exports = function(grunt) {
var tslintConfig = grunt.file.readJSON('tslint.json', { encoding: 'UTF-8' });
var rulesToSkip = {
'ban-types': true,
'match-default-export-name': true, // requires type checking
'prefer-conditional-expression': true, // not sure if this is needed
'type-literal-delimiter': true, // not sure if this is needed
'no-parameter-reassignment': true, // turn this on eventually
'match-default-export-name': true, // requires type checking
'deprecation': true, // requires type checking
'no-unnecessary-type-assertion': true, // requires type checking
'use-default-type-parameter': true, // requires type checking
'newline-before-return': true, // kind of a silly rule
'prefer-switch': true, // no need
'no-non-null-assertion': true, // in fact we prefer the opposite rule
'prefer-template': true, // rule does not handle multi-line strings nicely
'return-undefined': true, // requires type checking
Expand Down Expand Up @@ -384,6 +393,18 @@ module.exports = function(grunt) {

});

grunt.registerTask('generate-rule-metadata', 'A task that generates rule-metadata.json which contains a json array of all rule metadata', function () {

const allMetadata = []

getAllRules().forEach(function(ruleFile) {
const metadata = getMetadataFromFile(ruleFile)
allMetadata.push(metadata)
})

grunt.file.write('rule-metadata.json', JSON.stringify(allMetadata, null, 2), {encoding: 'UTF-8'});
});

grunt.registerTask('generate-recommendations', 'A task that generates the recommended_ruleset.js file', function () {

const groupedRows = {};
Expand Down Expand Up @@ -476,6 +497,7 @@ module.exports = function(grunt) {
'generate-recommendations',
'generate-default-tslint-json',
'generate-sdl-report',
'generate-rule-metadata',
'create-package-json-for-npm'
]);

Expand Down
27 changes: 13 additions & 14 deletions README.md

Large diffs are not rendered by default.

200 changes: 198 additions & 2 deletions additional_rule_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@
"issueType": "Warning",
"severity": "Low",
"group": "Clarity",
"recommendation": "[true, 3], // we generally recommend making one public class per file ",
"recommendation": "[true, 3], // we generally recommend making one public class per file",
"level": "Opportunity for Excellence"
},
"no-parameter-properties": {
Expand Down Expand Up @@ -975,8 +975,204 @@
"issueType": "Warning",
"severity": "Important",
"level": "Opportunity for Excellence",
"group": "Clarity",
"group": "Configurable",
"commonWeaknessEnumeration": "710",
"recommendation": "false, // this actually affect the readability of the code"
},
"ban-comma-operator": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710",
"recommendation": "true, // possibly controversial"
},
"binary-expression-operand-order": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710"
},
"deprecation": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Configurable",
"commonWeaknessEnumeration": "710",
"recommendation": "false, // deprecated APIs are sometimes unavoidable"
},
"no-duplicate-imports": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710"
},
"no-duplicate-switch-case": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Correctness",
"commonWeaknessEnumeration": "710"
},
"no-implicit-dependencies": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Correctness",
"commonWeaknessEnumeration": "710"
},
"no-irregular-whitespace": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Whitespace",
"commonWeaknessEnumeration": "710"
},
"encoding": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Whitespace",
"commonWeaknessEnumeration": "710"
},
"no-object-literal-type-assertion": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Correctness",
"commonWeaknessEnumeration": "710"
},
"no-parameter-reassignment": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Correctness",
"commonWeaknessEnumeration": "710"
},
"no-redundant-jsdoc": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Low",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710"
},
"no-return-await": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710"
},
"no-submodule-imports": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Correctness",
"commonWeaknessEnumeration": "710"
},
"no-this-assignment": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710"
},
"no-unnecessary-class": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710"
},
"no-unnecessary-type-assertion": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Moderate",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710"
},
"number-literal-format": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Low",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710"
},
"prefer-conditional-expression": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Low",
"level": "Opportunity for Excellence",
"group": "Configurable",
"commonWeaknessEnumeration": "710",
"recommendation": "false, // unnecessarily strict"
},
"prefer-object-spread": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Low",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710"
},
"prefer-switch": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Low",
"level": "Opportunity for Excellence",
"group": "Configurable",
"commonWeaknessEnumeration": "710",
"recommendation": "false, // more of a style preference"
},
"space-within-parens": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Low",
"level": "Opportunity for Excellence",
"group": "Whitespace",
"commonWeaknessEnumeration": "710"
},
"switch-final-break": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Low",
"level": "Opportunity for Excellence",
"group": "Correctness",
"commonWeaknessEnumeration": "710"
},
"type-literal-delimiter": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Low",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710"
},
"use-default-type-parameter": {
"issueClass": "Non-SDL",
"issueType": "Warning",
"severity": "Low",
"level": "Opportunity for Excellence",
"group": "Clarity",
"commonWeaknessEnumeration": "710"
}
}
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tslint-microsoft-contrib",
"version": "5.0.2",
"version": "5.0.4",
"description": "TSLint Rules for Microsoft",
"repository": {
"type": "git",
Expand Down Expand Up @@ -36,25 +36,26 @@
"test": "grunt all"
},
"dependencies": {
"tsutils": "^2.7.1"
"tsutils": "^2.12.1"
},
"devDependencies": {
"chai": "3.2.0",
"chai": "4.1.2",
"grunt": "^1.0.1",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-mocha-test": "0.13.2",
"grunt-mocha-test": "0.13.3",
"grunt-ts": "^6.0.0-beta.16",
"grunt-tslint": "^5.0.1",
"load-grunt-tasks": "3.2.0",
"mocha": "2.2.5",
"mocha": "4.0.1",
"time-grunt": "1.2.1",
"tslint": "5.1.0",
"typescript": "2.4.2",
"tslint": "5.8.0",
"typescript": "2.6.2",
"underscore": "1.8.3"
},
"peerDependencies": {
"tslint": ">=5.1.0"
"tslint": "^5.1.0",
"typescript": "^2.1.0"
}
}
Loading

0 comments on commit 6d137ca

Please sign in to comment.