JSON ESLint config
LintUse provides a JSON ESLint config that can be used to lint JSON files.
The config is based on the eslint-plugin-jsonc plugin.
Prerequisites
Install necessary dependencies:
sh
npm install -D lodash
1
sh
pnpm add -D lodash
1
sh
yarn add -D lodash
1
sh
bun add -D lodash
1
Configuration
js
import { eslint } from "@ljtang2009/lint-use";
import _ from "lodash";
export default [
{
..._.merge(_.cloneDeep(eslint.json.default), {
files: ['**/*.json', '**/*.jsonc', '**/*.json5'],
}),
},
];
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Configure ESlint reference ESLint official documentation.
Usage
sh
npx eslint .
1