Skip to content

Commit 7e6e8f5

Browse files
committed
feat: update pnpm plugin
1 parent 9ced2a5 commit 7e6e8f5

File tree

3 files changed

+62
-35
lines changed

3 files changed

+62
-35
lines changed

pnpm-lock.yaml

Lines changed: 31 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ catalogs:
6363
eslint-plugin-n: ^17.16.2
6464
eslint-plugin-no-only-tests: ^3.3.0
6565
eslint-plugin-perfectionist: ^4.10.1
66-
eslint-plugin-pnpm: ^0.2.0
66+
eslint-plugin-pnpm: ^0.3.0
6767
eslint-plugin-regexp: ^2.7.0
6868
eslint-plugin-toml: ^0.12.0
6969
eslint-plugin-unicorn: ^57.0.0

src/configs/pnpm.ts

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,47 @@ import type { TypedFlatConfigItem } from '../types'
33
import { interopDefault } from '../utils'
44

55
export async function pnpm(): Promise<TypedFlatConfigItem[]> {
6+
const [
7+
pluginPnpm,
8+
yamlParser,
9+
jsoncParser,
10+
] = await Promise.all([
11+
interopDefault(import('eslint-plugin-pnpm')),
12+
interopDefault(import('yaml-eslint-parser')),
13+
interopDefault(import('jsonc-eslint-parser')),
14+
])
15+
616
return [
717
{
818
files: [
919
'package.json',
1020
'**/package.json',
1121
],
1222
languageOptions: {
13-
parser: await interopDefault(import('jsonc-eslint-parser')),
23+
parser: jsoncParser,
24+
},
25+
name: 'antfu/pnpm/package-json',
26+
plugins: {
27+
pnpm: pluginPnpm,
28+
},
29+
rules: {
30+
'pnpm/json-enforce-catalog': 'error',
31+
'pnpm/json-prefer-workspace-settings': 'error',
32+
'pnpm/json-valid-catalog': 'error',
33+
},
34+
},
35+
{
36+
files: ['pnpm-workspace.yaml'],
37+
languageOptions: {
38+
parser: yamlParser,
1439
},
15-
name: 'antfu/pnpm/rules',
40+
name: 'antfu/pnpm/pnpm-workspace-yaml',
1641
plugins: {
17-
pnpm: await interopDefault(import('eslint-plugin-pnpm')),
42+
pnpm: pluginPnpm,
1843
},
1944
rules: {
20-
'pnpm/enforce-catalog': 'error',
21-
'pnpm/prefer-workspace-settings': 'error',
22-
'pnpm/valid-catalog': 'error',
45+
'pnpm/yaml-no-duplicate-catalog-item': 'error',
46+
'pnpm/yaml-no-unused-catalog-item': 'error',
2347
},
2448
},
2549
]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy