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

eslint-plugin-format-message

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-format-message - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

6

CHANGELOG.md
# Changelog
## 4.0.1
* **Bug Fix**
* fixed compatibility with ESLint 1.10
* fixed variables declared without initializer, later called as functions causing error
## 4.0.0

@@ -4,0 +10,0 @@

1

lib/util/ast.js

@@ -17,2 +17,3 @@ 'use strict'

node.type === 'VariableDeclarator' &&
node.init &&
node.init.type === 'CallExpression' &&

@@ -19,0 +20,0 @@ node.init.callee.type === 'Identifier' &&

51

lib/util/get-settings.js

@@ -8,33 +8,40 @@ 'use strict'

var settings = context.settings['format-message'] || {}
if (typeof settings.generateId !== 'function') {
var translations = settings.translations || (settings.translations = {})
if (typeof translations === 'string') {
try {
translations = settings.translations =
require(pathUtil.resolve(translations))
} catch (err) {
console.warn(err.message)
translations = settings.translations = {}
}
var resolved = {}
resolved.sourceLocale = settings.sourceLocale
var translations = {}
if (typeof settings.translations === 'string') {
try {
translations = require(pathUtil.resolve(settings.translations))
} catch (err) {
console.warn(err.message)
}
Object.keys(translations).forEach(function (locale) {
if (typeof translations[locale] === 'string') {
} else if (typeof settings.translations === 'object') {
Object.keys(settings.translations).forEach(function (locale) {
var localeData = settings.translations[locale]
if (typeof localeData === 'string') {
try {
translations[locale] = require(pathUtil.resolve(translations[locale]))[locale]
localeData = require(pathUtil.resolve(localeData))
if (localeData[locale]) localeData = localeData[locale]
} catch (err) {
localeData = {}
console.warn(err.message)
translations[locale] = null
}
}
translations[locale] = localeData
})
var generateId = generate[settings.generateId] || generate.underscored_crc32
settings.generateId = function (pattern) {
try {
return generateId(pattern)
} catch (_) {
return null
}
}
resolved.translations = translations
var generateId = generate[settings.generateId] || generate.underscored_crc32
resolved.generateId = function (pattern) {
try {
return generateId(pattern)
} catch (_) {
return null
}
}
return settings
return resolved
}
{
"name": "eslint-plugin-format-message",
"version": "4.0.0",
"version": "4.0.1",
"description": "format-message i18n specific rules for ESLint",

@@ -5,0 +5,0 @@ "author": "Andy VanWagoner <thetalecrafter@gmail.com> (https://thetalecrafter.com/)",

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