Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' into camelcase-rule
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher authored Nov 27, 2018
2 parents 5dd4f20 + e550d5e commit e60235d
Show file tree
Hide file tree
Showing 58 changed files with 4,244 additions and 3,807 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
insert_final_newline = true
21 changes: 21 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"root": true,
"plugins": [
"node",
"prettier"
],
"extends": [
"eslint",
"plugin:node/recommended",
"prettier"
],
"rules": {
"prettier/prettier": [
"error",
{
"tabWidth": 4
}
],
"lines-around-comment": "off"
}
}
15 changes: 0 additions & 15 deletions .eslintrc.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ Please try to avoid code that isn't directly related to the bug, as it makes it
**Actual Result**



**Additional Info**


**Versions**

** Versions **
| package | version |
| -------------------------- | ------- |
| `eslint-plugin-typescript` | `X.Y.Z` |
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ versions.json
.eslintcache
.cache
/packages/**/node_modules
/.vscode
.sublimelinterrc
yarn.lock
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"proseWrap": "preserve",
"semi": true,
"singleQuote": false,
"tabWidth": 4,
"trailingComma": "es5",
"useTabs": false
}
38 changes: 38 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
// Format a file on save. A formatter must be available, the file must not be auto-saved, and editor must not be shutting down.
"editor.formatOnSave": true,

// An array of languages where Emmet abbreviations should not be expanded.
"emmet.excludeLanguages": [
"markdown",
"typescript"
],

// An array of language ids which should be validated by ESLint
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "typescript",
"autoFix": true
},
{
"language": "typescriptreact",
"autoFix": true
}
],

// When enabled, will trim trailing whitespace when saving a file.
"files.trimTrailingWhitespace": true,

// Use 'prettier-eslint' instead of 'prettier'. Other settings will only be fallbacks in case they could not be inferred from eslint rules.
"prettier.eslintIntegration": true,

// typescript auto-format settings
"typescript.tsdk": "node_modules/typescript/lib",
"javascript.preferences.importModuleSpecifier": "auto",
"typescript.preferences.importModuleSpecifier": "auto",
"javascript.preferences.quoteStyle": "double",
"typescript.preferences.quoteStyle": "double",
"typescript.updateImportsOnFileMove.enabled": "always",
}
10 changes: 5 additions & 5 deletions lib/rules/adjacent-overload-signatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ module.exports = {
description: "Require that member overloads be consecutive",
category: "TypeScript",
url:
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/adjacent-overload-signatures.md"
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/adjacent-overload-signatures.md",
},
schema: []
schema: [],
},

create(context) {
Expand Down Expand Up @@ -92,7 +92,7 @@ module.exports = {
if (index > -1 && lastName !== name) {
context.report({
node: member,
message: `All '${name}' signatures should be adjacent`
message: `All '${name}' signatures should be adjacent`,
});
} else if (name && index === -1) {
seen.push(name);
Expand All @@ -111,7 +111,7 @@ module.exports = {
TSTypeLiteral: checkBodyForOverloadMethods,
TSInterfaceBody: checkBodyForOverloadMethods,
ClassBody: checkBodyForOverloadMethods,
Program: checkBodyForOverloadMethods
Program: checkBodyForOverloadMethods,
};
}
},
};
10 changes: 5 additions & 5 deletions lib/rules/class-name-casing.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ module.exports = {
category: "Best Practices",
recommended: true,
url:
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/class-name-casing.md"
}
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/class-name-casing.md",
},
},

create(context) {
Expand Down Expand Up @@ -63,7 +63,7 @@ module.exports = {

context.report({
node: id,
message: `${friendlyName} '${id.name}' must be PascalCased`
message: `${friendlyName} '${id.name}' must be PascalCased`,
});
}

Expand All @@ -88,7 +88,7 @@ module.exports = {
report(node.init, id);
}
}
}
},
};
}
},
};
18 changes: 9 additions & 9 deletions lib/rules/explicit-function-return-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ module.exports = {

category: "TypeScript",
url:
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/explicit-function-return-type.md"
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/explicit-function-return-type.md",
},
schema: [
{
type: "object",
properties: {
allowExpressions: {
type: "boolean"
}
type: "boolean",
},
},
additionalProperties: false
}
]
additionalProperties: false,
},
],
},

create(context) {
Expand Down Expand Up @@ -86,7 +86,7 @@ module.exports = {
) {
context.report({
node,
message: `Missing return type on function.`
message: `Missing return type on function.`,
});
}
}
Expand All @@ -97,7 +97,7 @@ module.exports = {
return {
FunctionDeclaration: checkFunctionReturnType,
FunctionExpression: checkFunctionReturnType,
ArrowFunctionExpression: checkFunctionReturnType
ArrowFunctionExpression: checkFunctionReturnType,
};
}
},
};
12 changes: 6 additions & 6 deletions lib/rules/explicit-member-accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ module.exports = {
extraDescription: [util.tslintRule("member-access")],
category: "TypeScript",
url:
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/explicit-member-accessibility.md"
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/explicit-member-accessibility.md",
},
schema: []
schema: [],
},

create(context) {
Expand All @@ -43,7 +43,7 @@ module.exports = {
node: methodDefinition,
message: `Missing accessibility modifier on method definition ${
methodDefinition.key.name
}.`
}.`,
});
}
}
Expand All @@ -63,7 +63,7 @@ module.exports = {
node: classProperty,
message: `Missing accessibility modifier on class property ${
classProperty.key.name
}.`
}.`,
});
}
}
Expand All @@ -73,7 +73,7 @@ module.exports = {
//----------------------------------------------------------------------
return {
ClassProperty: checkPropertyAccessibilityModifier,
MethodDefinition: checkMethodAccessibilityModifier
MethodDefinition: checkMethodAccessibilityModifier,
};
}
},
};
10 changes: 5 additions & 5 deletions lib/rules/generic-type-naming.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function createTypeParameterChecker(context, rule) {
node,
message:
"Type parameter {{name}} does not match rule {{rule}}",
data
data,
});
}
}
Expand All @@ -45,8 +45,8 @@ module.exports = {
description: "Enforces naming of generic type variables",
category: "TypeScript",
url:
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/generic-type-naming.md"
}
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/generic-type-naming.md",
},
},

create(context) {
Expand All @@ -65,7 +65,7 @@ module.exports = {
TSInterfaceDeclaration: checkTypeParameters,
FunctionDeclaration: checkTypeParameters,
TSCallSignature: checkTypeParameters,
CallSignature: checkTypeParameters
CallSignature: checkTypeParameters,
};
}
},
};
16 changes: 8 additions & 8 deletions lib/rules/interface-name-prefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ module.exports = {
extraDescription: [util.tslintRule("interface-name")],
category: "TypeScript",
url:
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/interface-name-prefix.md"
"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/interface-name-prefix.md",
},
schema: [
{
enum: ["never", "always"]
}
]
enum: ["never", "always"],
},
],
},

create(context) {
Expand Down Expand Up @@ -58,14 +58,14 @@ module.exports = {
if (isPrefixedWithI(interfaceNode.id.name)) {
context.report({
node: interfaceNode.id,
message: 'Interface name must not be prefixed with "I"'
message: 'Interface name must not be prefixed with "I"',
});
}
} else {
if (!isPrefixedWithI(interfaceNode.id.name)) {
context.report({
node: interfaceNode.id,
message: 'Interface name must be prefixed with "I"'
message: 'Interface name must be prefixed with "I"',
});
}
}
Expand All @@ -75,7 +75,7 @@ module.exports = {
// Public
//----------------------------------------------------------------------
return {
TSInterfaceDeclaration: checkInterfacePrefix
TSInterfaceDeclaration: checkInterfacePrefix,
};
}
},
};
Loading

0 comments on commit e60235d

Please sign in to comment.