@blitz/eslint-plugin
Advanced tools
Comparing version 0.0.34 to 0.0.35
@@ -12,3 +12,2 @@ "use strict"; | ||
docs: { | ||
category: 'Best Practices', | ||
description: 'Ensures all case statements are block scoped', | ||
@@ -15,0 +14,0 @@ recommended: 'error', |
@@ -18,3 +18,2 @@ "use strict"; | ||
docs: { | ||
category: 'Best Practices', | ||
description: 'Enforce a specific parameter name in catch clauses', | ||
@@ -21,0 +20,0 @@ recommended: 'error', |
@@ -56,3 +56,2 @@ "use strict"; | ||
docs: { | ||
category: 'Best Practices', | ||
description: (0, messages_1.oneLine) `Enforce block comments to start with a capital first letter and end with a dot and | ||
@@ -59,0 +58,0 @@ line comments to not start with a capital first letter and no dot |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.defaultOptions = exports.ruleName = void 0; | ||
const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); | ||
const lines_around_comment_1 = __importDefault(require("eslint/lib/rules/lines-around-comment")); | ||
const utils_1 = require("@typescript-eslint/utils"); | ||
const util_1 = require("../util"); | ||
exports.ruleName = 'lines-around-comment'; | ||
const baseRule = utils_1.ESLintUtils.nullThrows(require('eslint/use-at-your-own-risk').builtinRules.get(exports.ruleName), ''); | ||
exports.defaultOptions = { | ||
@@ -40,3 +37,2 @@ beforeBlockComment: true, | ||
description: 'Require empty lines around comments', | ||
category: 'Stylistic Issues', | ||
recommended: false, | ||
@@ -137,4 +133,4 @@ extendsBaseRule: true, | ||
], | ||
fixable: lines_around_comment_1.default.meta.fixable, | ||
messages: lines_around_comment_1.default.meta.messages, | ||
fixable: baseRule.meta.fixable, | ||
messages: baseRule.meta.messages, | ||
}, | ||
@@ -162,3 +158,3 @@ defaultOptions: [exports.defaultOptions], | ||
} | ||
return node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression && node.object.type === objectType; | ||
return node.type === utils_1.AST_NODE_TYPES.MemberExpression && node.object.type === objectType; | ||
} | ||
@@ -174,3 +170,3 @@ const allowSwitchStart = options === null || options === void 0 ? void 0 : options.allowSwitchStart; | ||
const allowMemberCallExpression = options === null || options === void 0 ? void 0 : options.allowMemberCallExpression; | ||
const rules = lines_around_comment_1.default.create(Object.create(context, { | ||
const rules = baseRule.create(Object.create(context, { | ||
report: { | ||
@@ -181,12 +177,12 @@ enumerable: true, | ||
if ((parentNode && parentNode.type === 'CallExpression') || | ||
(isCommentAtParentStart(descriptor.node, experimental_utils_1.AST_NODE_TYPES.SwitchStatement) && allowSwitchStart) || | ||
(isCommentAtParentEnd(descriptor.node, experimental_utils_1.AST_NODE_TYPES.SwitchStatement) && allowSwitchEnd) || | ||
(isCommentAtParentStart(descriptor.node, experimental_utils_1.AST_NODE_TYPES.TSEnumDeclaration) && allowEnumStart) || | ||
(isCommentAtParentEnd(descriptor.node, experimental_utils_1.AST_NODE_TYPES.TSEnumDeclaration) && allowEnumEnd) || | ||
(isCommentAtParentStart(descriptor.node, experimental_utils_1.AST_NODE_TYPES.TSInterfaceBody) && allowInterfaceStart) || | ||
(isCommentAtParentEnd(descriptor.node, experimental_utils_1.AST_NODE_TYPES.TSInterfaceBody) && allowInterfaceEnd) || | ||
(isCommentAtParentStart(descriptor.node, experimental_utils_1.AST_NODE_TYPES.TSTypeLiteral) && allowObjectStart) || | ||
(isCommentAtParentEnd(descriptor.node, experimental_utils_1.AST_NODE_TYPES.TSTypeLiteral) && allowObjectEnd) || | ||
((isMemberExpression(parentNode, experimental_utils_1.AST_NODE_TYPES.CallExpression) || | ||
isMemberExpression(parentNode, experimental_utils_1.AST_NODE_TYPES.Identifier)) && | ||
(isCommentAtParentStart(descriptor.node, utils_1.AST_NODE_TYPES.SwitchStatement) && allowSwitchStart) || | ||
(isCommentAtParentEnd(descriptor.node, utils_1.AST_NODE_TYPES.SwitchStatement) && allowSwitchEnd) || | ||
(isCommentAtParentStart(descriptor.node, utils_1.AST_NODE_TYPES.TSEnumDeclaration) && allowEnumStart) || | ||
(isCommentAtParentEnd(descriptor.node, utils_1.AST_NODE_TYPES.TSEnumDeclaration) && allowEnumEnd) || | ||
(isCommentAtParentStart(descriptor.node, utils_1.AST_NODE_TYPES.TSInterfaceBody) && allowInterfaceStart) || | ||
(isCommentAtParentEnd(descriptor.node, utils_1.AST_NODE_TYPES.TSInterfaceBody) && allowInterfaceEnd) || | ||
(isCommentAtParentStart(descriptor.node, utils_1.AST_NODE_TYPES.TSTypeLiteral) && allowObjectStart) || | ||
(isCommentAtParentEnd(descriptor.node, utils_1.AST_NODE_TYPES.TSTypeLiteral) && allowObjectEnd) || | ||
((isMemberExpression(parentNode, utils_1.AST_NODE_TYPES.CallExpression) || | ||
isMemberExpression(parentNode, utils_1.AST_NODE_TYPES.Identifier)) && | ||
allowMemberCallExpression)) { | ||
@@ -193,0 +189,0 @@ return; |
@@ -13,3 +13,2 @@ "use strict"; | ||
docs: { | ||
category: 'Stylistic Issues', | ||
description: (0, common_tags_1.oneLine) ` | ||
@@ -21,2 +20,3 @@ Require an empty line before 'return' statements, only for block statemenet with more than 2 nodes | ||
fixable: 'whitespace', | ||
hasSuggestions: true, | ||
schema: [ | ||
@@ -23,0 +23,0 @@ { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createRule = void 0; | ||
const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); | ||
const utils_1 = require("@typescript-eslint/utils"); | ||
const version = require('../../package.json').version; | ||
exports.createRule = experimental_utils_1.ESLintUtils.RuleCreator((name) => { | ||
exports.createRule = utils_1.ESLintUtils.RuleCreator((name) => { | ||
return `https://github.com/stackblitz/eslint-plugin/blob/v${version}/docs/rules/${name}.md`; | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@blitz/eslint-plugin", | ||
"version": "0.0.34", | ||
"version": "0.0.35", | ||
"description": "An ESLint config to enforce a consistent code styles across StackBlitz projects", | ||
@@ -28,6 +28,6 @@ "keywords": [ | ||
"@typescript-eslint/eslint-plugin": "5.14.0", | ||
"@typescript-eslint/experimental-utils": "^4.20.0", | ||
"@typescript-eslint/parser": "^5.14.0", | ||
"@typescript-eslint/utils": "^5.14.0", | ||
"common-tags": "^1.8.0", | ||
"eslint": "^7.32.0", | ||
"eslint": "^8.11.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
@@ -42,4 +42,5 @@ "eslint-plugin-prettier": "^4.0.0" | ||
"@types/node": "^14.6.0", | ||
"eslint-etc": "^4.0.4", | ||
"eslint-etc": "^5.1.0", | ||
"jest": "^27.5.1", | ||
"jest-node-exports-resolver": "^1.1.5", | ||
"prettier": "^2.5.1", | ||
@@ -46,0 +47,0 @@ "ts-jest": "^27.1.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
66609
11
854
+ Added@eslint-community/eslint-utils@4.4.0(transitive)
+ Added@eslint-community/regexpp@4.10.0(transitive)
+ Added@eslint/eslintrc@2.1.4(transitive)
+ Added@eslint/js@8.57.0(transitive)
+ Added@humanwhocodes/config-array@0.11.14(transitive)
+ Added@humanwhocodes/module-importer@1.0.1(transitive)
+ Added@humanwhocodes/object-schema@2.0.3(transitive)
+ Added@types/semver@7.5.8(transitive)
+ Added@typescript-eslint/utils@5.62.0(transitive)
+ Added@ungap/structured-clone@1.2.0(transitive)
+ Addedacorn@8.11.3(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedeslint@8.57.0(transitive)
+ Addedeslint-scope@7.2.2(transitive)
+ Addedespree@9.6.1(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedglob-parent@6.0.2(transitive)
+ Addedgraphemer@1.4.0(transitive)
+ Addedis-path-inside@3.0.3(transitive)
+ Addedjs-yaml@4.1.0(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removed@babel/code-frame@7.12.11(transitive)
- Removed@babel/helper-validator-identifier@7.24.6(transitive)
- Removed@babel/highlight@7.24.6(transitive)
- Removed@eslint/eslintrc@0.4.3(transitive)
- Removed@humanwhocodes/config-array@0.5.0(transitive)
- Removed@humanwhocodes/object-schema@1.2.1(transitive)
- Removed@typescript-eslint/experimental-utils@4.33.0(transitive)
- Removed@typescript-eslint/scope-manager@4.33.0(transitive)
- Removed@typescript-eslint/types@4.33.0(transitive)
- Removed@typescript-eslint/typescript-estree@4.33.0(transitive)
- Removed@typescript-eslint/visitor-keys@4.33.0(transitive)
- Removedacorn@7.4.1(transitive)
- Removedajv@8.14.0(transitive)
- Removedansi-colors@4.1.3(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedargparse@1.0.10(transitive)
- Removedastral-regex@2.0.0(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedenquirer@2.4.1(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedeslint@7.32.0(transitive)
- Removedeslint-utils@2.1.0(transitive)
- Removedeslint-visitor-keys@1.3.0(transitive)
- Removedespree@7.3.1(transitive)
- Removedesprima@4.0.1(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedignore@4.0.6(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedjson-schema-traverse@1.0.0(transitive)
- Removedlodash.truncate@4.4.2(transitive)
- Removedpicocolors@1.0.1(transitive)
- Removedprogress@2.0.3(transitive)
- Removedrequire-from-string@2.0.2(transitive)
- Removedslice-ansi@4.0.0(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedstring-width@4.2.3(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedtable@6.8.2(transitive)
- Removedv8-compile-cache@2.4.0(transitive)
Updatedeslint@^8.11.0