eslint-plugin-t
Advanced tools
Comparing version 1.1.0 to 1.2.0
{ | ||
"name": "eslint-plugin-t", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"main": "./src/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
const stringLiteralRule = require('./string-literal'); | ||
const arrayLiteralRule = require('./array-literal'); | ||
const rules = { | ||
'string-literal': stringLiteralRule, | ||
'array-literal': arrayLiteralRule, | ||
}; | ||
module.exports = { rules }; |
@@ -0,1 +1,3 @@ | ||
const isStringLiteral = require('./helpers/isStringLiteral'); | ||
module.exports = { | ||
@@ -24,10 +26,3 @@ create: (context) => { | ||
let arg = args[0]; | ||
if ( | ||
// Not a literal | ||
(arg.type !== 'Literal' && arg.type !== 'TemplateLiteral') || | ||
// Non-string literal. | ||
(arg.type === 'Literal' && typeof arg.value !== 'string') || | ||
// Template literal with expressions. | ||
(arg.type === 'TemplateLiteral' && arg.expressions.length) | ||
) { | ||
if (!isStringLiteral(arg)) { | ||
context.report({ | ||
@@ -34,0 +29,0 @@ node: arg, |
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
3686
5
102