eslint-plugin-formatjs
Advanced tools
Comparing version 1.5.11 to 1.6.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.6.0](https://github.com/formatjs/formatjs/compare/eslint-plugin-formatjs@1.5.11...eslint-plugin-formatjs@1.6.0) (2020-03-01) | ||
### Features | ||
* **eslint-plugin-formatjs:** add support for defaultMessage ([#524](https://github.com/formatjs/formatjs/issues/524)) ([63742d6](https://github.com/formatjs/formatjs/commit/63742d697732f2e88176c8f310f89bf65c2f9576)) | ||
## [1.5.11](https://github.com/formatjs/formatjs/compare/eslint-plugin-formatjs@1.5.10...eslint-plugin-formatjs@1.5.11) (2020-01-27) | ||
@@ -8,0 +19,0 @@ |
declare const plugin: { | ||
rules: { | ||
'enforce-description': import("eslint").Rule.RuleModule; | ||
'enforce-default-message': import("eslint").Rule.RuleModule; | ||
'no-camel-case': import("eslint").Rule.RuleModule; | ||
@@ -5,0 +6,0 @@ 'no-emoji': import("eslint").Rule.RuleModule; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const enforce_description_1 = require("./rules/enforce-description"); | ||
const enforce_default_message_1 = require("./rules/enforce-default-message"); | ||
const no_camel_case_1 = require("./rules/no-camel-case"); | ||
@@ -15,2 +16,3 @@ const no_emoji_1 = require("./rules/no-emoji"); | ||
'enforce-description': enforce_description_1.default, | ||
'enforce-default-message': enforce_default_message_1.default, | ||
'no-camel-case': no_camel_case_1.default, | ||
@@ -17,0 +19,0 @@ 'no-emoji': no_emoji_1.default, |
{ | ||
"name": "eslint-plugin-formatjs", | ||
"version": "1.5.11", | ||
"version": "1.6.0", | ||
"description": "ESLint plugin for formatjs", | ||
@@ -37,3 +37,4 @@ "main": "dist/index.js", | ||
"eslint": "^6.0.0" | ||
} | ||
}, | ||
"gitHead": "f7f8ddb5ba81afbe04e7da8f438e08662096ae11" | ||
} |
@@ -126,2 +126,26 @@ # eslint-plugin-formatjs | ||
### `enforce-default-message` | ||
This enforces `defaultMessage` in the message descriptor. | ||
#### Why | ||
- Can be usefull in case we want to extract messages for translations from source code. This way can make sure people won't forget about defaultMessage | ||
```tsx | ||
import {defineMessages} from 'react-intl'; | ||
const messages = defineMessages({ | ||
// WORKS | ||
foo: { | ||
defaultMessage: 'This is default message', | ||
description: 'bar', | ||
}, | ||
// FAILS | ||
bar: { | ||
description: 'bar', | ||
}, | ||
}); | ||
``` | ||
### `enforce-placeholders` | ||
@@ -128,0 +152,0 @@ |
import enforceDescription from './rules/enforce-description'; | ||
import enforceDefaultMessage from './rules/enforce-default-message'; | ||
import noCamelCase from './rules/no-camel-case'; | ||
@@ -13,2 +14,3 @@ import noEmoji from './rules/no-emoji'; | ||
'enforce-description': enforceDescription, | ||
'enforce-default-message': enforceDefaultMessage, | ||
'no-camel-case': noCamelCase, | ||
@@ -15,0 +17,0 @@ 'no-emoji': noEmoji, |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
103099
52
1983
339
0