eslint-plugin-kaizai
Advanced tools
Comparing version 1.0.15 to 1.0.16
@@ -9,7 +9,7 @@ "use strict"; | ||
exports.default = RuleCreator({ | ||
name: "no-console-log", | ||
name: "no-chinese-character", | ||
meta: { | ||
type: "problem", | ||
docs: { | ||
description: "Disallow console.log", | ||
description: "could not have chinese character", | ||
recommended: "error" | ||
@@ -19,3 +19,3 @@ }, | ||
messages: { | ||
'noChineseCharacter': "console.log is not allowed" | ||
'noChineseCharacter': "could not have chinese character" | ||
} | ||
@@ -34,3 +34,3 @@ }, | ||
Literal(node) { | ||
if (isChineseCharacter(node.value.value)) { | ||
if (typeof node.value === 'string' && isChineseCharacter(node.value)) { | ||
report(node); | ||
@@ -37,0 +37,0 @@ } |
{ | ||
"name": "eslint-plugin-kaizai", | ||
"version": "1.0.15", | ||
"version": "1.0.16", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
import { ESLintUtils } from "@typescript-eslint/experimental-utils"; | ||
import { TSESTree } from "@typescript-eslint/experimental-utils"; | ||
import { isStringLiteral } from "typescript"; | ||
@@ -14,7 +15,7 @@ const RuleCreator = ESLintUtils.RuleCreator(name => name); | ||
export default RuleCreator<Options, MessageIds>({ | ||
name: "no-console-log", | ||
name: "no-chinese-character", | ||
meta: { | ||
type: "problem", | ||
docs: { | ||
description: "Disallow console.log", | ||
description: "could not have chinese character", | ||
recommended: "error" | ||
@@ -24,3 +25,3 @@ }, | ||
messages: { | ||
'noChineseCharacter': "console.log is not allowed" | ||
'noChineseCharacter': "could not have chinese character" | ||
} | ||
@@ -40,4 +41,4 @@ }, | ||
return { | ||
Literal(node) { | ||
if (isChineseCharacter((node as any).value.value)) { | ||
Literal(node: TSESTree.Literal) { | ||
if (typeof node.value === 'string' && isChineseCharacter(node.value)) { | ||
report(node); | ||
@@ -44,0 +45,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23927
457