Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(presets): add eslint-stylistic monorepo and add to eslint group #28812

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/config/presets/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ exports[`config/presets/index resolvePreset resolves eslint 1`] = `
],
"matchPackagePrefixes": [
"@eslint/",
"@stylistic/eslint-plugin",
"@types/eslint__",
"@typescript-eslint/",
"eslint",
Expand Down Expand Up @@ -154,6 +155,7 @@ exports[`config/presets/index resolvePreset resolves linters 1`] = `
"matchPackagePrefixes": [
"ember-template-lint",
"@eslint/",
"@stylistic/eslint-plugin",
"@types/eslint__",
"@typescript-eslint/",
"eslint",
Expand Down Expand Up @@ -192,6 +194,7 @@ exports[`config/presets/index resolvePreset resolves nested groups 1`] = `
"matchPackagePrefixes": [
"ember-template-lint",
"@eslint/",
"@stylistic/eslint-plugin",
"@types/eslint__",
"@typescript-eslint/",
"eslint",
Expand Down
8 changes: 5 additions & 3 deletions lib/config/presets/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ describe('config/presets/index', () => {
],
matchPackagePrefixes: [
'@eslint/',
'@stylistic/eslint-plugin',
'@types/eslint__',
'@typescript-eslint/',
'eslint',
Expand Down Expand Up @@ -268,6 +269,7 @@ describe('config/presets/index', () => {
],
matchPackagePrefixes: [
'@eslint/',
'@stylistic/eslint-plugin',
'@types/eslint__',
'@typescript-eslint/',
'eslint',
Expand All @@ -281,7 +283,7 @@ describe('config/presets/index', () => {
config.extends = ['packages:eslint'];
const res = await presets.resolveConfigPresets(config);
expect(res).toMatchSnapshot();
expect(res.matchPackagePrefixes).toHaveLength(4);
expect(res.matchPackagePrefixes).toHaveLength(5);
});

it('resolves linters', async () => {
Expand All @@ -290,7 +292,7 @@ describe('config/presets/index', () => {
expect(res).toMatchSnapshot();
expect(res.matchPackageNames).toHaveLength(11);
expect(res.matchPackagePatterns).toHaveLength(1);
expect(res.matchPackagePrefixes).toHaveLength(6);
expect(res.matchPackagePrefixes).toHaveLength(7);
});

it('resolves nested groups', async () => {
Expand All @@ -301,7 +303,7 @@ describe('config/presets/index', () => {
expect(rule.automerge).toBeTrue();
expect(rule.matchPackageNames).toHaveLength(11);
expect(rule.matchPackagePatterns).toHaveLength(1);
expect(rule.matchPackagePrefixes).toHaveLength(6);
expect(rule.matchPackagePrefixes).toHaveLength(7);
});

it('migrates automerge in presets', async () => {
Expand Down
1 change: 1 addition & 0 deletions lib/config/presets/internal/monorepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ const repoGroups = {
emotion: 'https://github.com/emotion-js/emotion',
'eslint-config-globex':
'https://github.com/GlobexDesignsInc/eslint-config-globex',
'eslint-stylistic': 'https://github.com/eslint-stylistic/eslint-stylistic',
expo: 'https://github.com/expo/expo',
'fabric-chaincode-node':
'https://github.com/hyperledger/fabric-chaincode-node',
Expand Down
1 change: 1 addition & 0 deletions lib/config/presets/internal/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const presets: Record<string, Preset> = {
],
matchPackagePrefixes: [
'@eslint/',
'@stylistic/eslint-plugin',
'@types/eslint__',
'@typescript-eslint/',
'eslint',
Expand Down