1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| import type { Linter } from 'eslint';
|
| import { interopDefault } from '../util';
|
| export async function pnpm(): Promise<Linter.Config[]> {
| const [pluginPnpm, parserPnpm] = await Promise.all([
| interopDefault(import('eslint-plugin-pnpm')),
| interopDefault(import('yaml-eslint-parser')),
| ] as const);
|
| return [
| {
| files: ['package.json', '**/package.json'],
| language: 'jsonc/x',
| plugins: {
| pnpm: pluginPnpm,
| },
| rules: {
| 'pnpm/json-enforce-catalog': 'error',
| 'pnpm/json-prefer-workspace-settings': 'error',
| 'pnpm/json-valid-catalog': 'error',
| },
| },
| {
| files: ['pnpm-workspace.yaml'],
| languageOptions: {
| parser: parserPnpm,
| },
| plugins: {
| pnpm: pluginPnpm,
| },
| rules: {
| 'pnpm/yaml-no-duplicate-catalog-item': 'error',
| 'pnpm/yaml-no-unused-catalog-item': 'error',
| },
| },
| ];
| }
|
|