Skip to content

Commit

Permalink
Allow more granular composition of rule configuration (palantir#2284)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchen63 authored and adidahiya committed Mar 2, 2017
1 parent 8c13b52 commit 7a782a3
Show file tree
Hide file tree
Showing 16 changed files with 713 additions and 496 deletions.
47 changes: 26 additions & 21 deletions src/configs/latest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ export const rules = {
"no-angle-bracket-type-assertion": true,

// added in v4.1
"only-arrow-functions": [true,
"allow-declarations",
// the following option was added in 4.1
"allow-named-functions",
],
"only-arrow-functions": {
options: [
"allow-declarations",
// the following option was added in 4.1
"allow-named-functions",
],
},
"prefer-const": true,

// added in v4.2
Expand All @@ -38,13 +40,15 @@ export const rules = {

// added in v4.3
"import-spacing": true,
"space-before-function-paren": [true, {
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never",
}],
"space-before-function-paren": {
options: {
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never",
},
},
"typeof-compare": true,
"unified-signatures": true,

Expand All @@ -54,15 +58,16 @@ export const rules = {
"no-misused-new": true,

// added in v4.5
"ban-types": [
true,
["Object", "Avoid using the `Object` type. Did you mean `object`?"],
["Function", "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."],
["Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?"],
["Number", "Avoid using the `Number` type. Did you mean `number`?"],
["String", "Avoid using the `String` type. Did you mean `string`?"],
["Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?"],
],
"ban-types": {
options: [
["Object", "Avoid using the `Object` type. Did you mean `object`?"],
["Function", "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."],
["Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?"],
["Number", "Avoid using the `Number` type. Did you mean `number`?"],
["String", "Avoid using the `String` type. Did you mean `string`?"],
["Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?"],
],
},
"no-duplicate-super": true,
};
// tslint:enable object-literal-sort-keys
Expand Down
Loading

0 comments on commit 7a782a3

Please sign in to comment.