Skip to content

Commit

Permalink
fix: add package to eslint parser options (#1379)
Browse files Browse the repository at this point in the history
To support linting a file using the nearest config add `package: true`
to the default parser options.
  • Loading branch information
achingbrain authored Oct 6, 2023
1 parent dabd450 commit eb9f72f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/check-project/manifests/typed-cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export async function typedCJSManifest (manifest, branchName, repoUrl, homePage
'dist'
],
eslintConfig: merge({
extends: 'ipfs'
extends: 'ipfs',
parserOptions: {
package: true
}
}, manifest.eslintConfig),
release: (manifest.scripts?.release?.includes('semantic-release') || manifest.scripts?.release?.includes('aegir release')) ? semanticReleaseConfig(branchName) : undefined
}, repoUrl, homePage)
Expand Down
1 change: 1 addition & 0 deletions src/check-project/manifests/typed-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export async function typedESMManifest (manifest, branchName, repoUrl, homePage
eslintConfig: merge({
extends: 'ipfs',
parserOptions: {
package: true,
sourceType: 'module'
}
}, manifest.eslintConfig),
Expand Down
1 change: 1 addition & 0 deletions src/check-project/manifests/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export async function typescriptManifest (manifest, branchName, repoUrl, homePag
eslintConfig: merge({
extends: 'ipfs',
parserOptions: {
package: true,
sourceType: 'module'
}
}, manifest.eslintConfig),
Expand Down
5 changes: 4 additions & 1 deletion src/check-project/manifests/untyped-cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export async function untypedCJSManifest (manifest, branchName, repoUrl, homePag
'dist'
],
eslintConfig: merge({
extends: 'ipfs'
extends: 'ipfs',
parserOptions: {
package: true
}
}, manifest.eslintConfig),
release: (manifest.scripts?.release?.includes('semantic-release') || manifest.scripts?.release?.includes('aegir release')) ? semanticReleaseConfig(branchName) : undefined
}, repoUrl, homePage)
Expand Down
1 change: 1 addition & 0 deletions src/check-project/manifests/untyped-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export async function untypedESMManifest (manifest, branchName, repoUrl, homePag
eslintConfig: merge({
extends: 'ipfs',
parserOptions: {
package: true,
sourceType: 'module'
}
}, manifest.eslintConfig),
Expand Down

0 comments on commit eb9f72f

Please sign in to comment.