Skip to content

Commit

Permalink
feat: enable no-unsafe-values and add it to recommended configurati…
Browse files Browse the repository at this point in the history
…on (#51)
  • Loading branch information
mdjermanovic authored Nov 7, 2024
1 parent 8ba46b0 commit 72273f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,6 +30,7 @@ const plugin = {
rules: {
"no-duplicate-keys": noDuplicateKeys,
"no-empty-keys": noEmptyKeys,
"no-unsafe-values": noUnsafeValues,
},
configs: {},
};
Expand All @@ -39,6 +41,7 @@ Object.assign(plugin.configs, {
rules: {
"json/no-duplicate-keys": "error",
"json/no-empty-keys": "error",
"json/no-unsafe-values": "error",
},
},
});
Expand Down

0 comments on commit 72273f5

Please sign in to comment.