diff --git a/README.md b/README.md index 4050e5e..5642f1c 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ export default [ - `no-duplicate-keys` - warns when there are two keys in an object with the same text. - `no-empty-keys` - warns when there is a key in an object that is an empty string or contains only whitespace (note: `package-lock.json` uses empty keys intentionally) +- `no-unsafe-values` - warns on values that are unsafe for interchange, such as numbers outside safe range or lone surrogates. ## Configuration Comments diff --git a/src/index.js b/src/index.js index a92ed19..4b74b45 100644 --- a/src/index.js +++ b/src/index.js @@ -11,6 +11,7 @@ import { JSONLanguage } from "./languages/json-language.js"; import { JSONSourceCode } from "./languages/json-source-code.js"; import noDuplicateKeys from "./rules/no-duplicate-keys.js"; import noEmptyKeys from "./rules/no-empty-keys.js"; +import noUnsafeValues from "./rules/no-unsafe-values.js"; //----------------------------------------------------------------------------- // Plugin @@ -29,6 +30,7 @@ const plugin = { rules: { "no-duplicate-keys": noDuplicateKeys, "no-empty-keys": noEmptyKeys, + "no-unsafe-values": noUnsafeValues, }, configs: {}, }; @@ -39,6 +41,7 @@ Object.assign(plugin.configs, { rules: { "json/no-duplicate-keys": "error", "json/no-empty-keys": "error", + "json/no-unsafe-values": "error", }, }, });