Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-t

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-t - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

src/array-literal.js

2

package.json
{
"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,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc