Skip to content

Commit

Permalink
feat(presets): add eslint-stylistic monorepo and add to eslint group (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed May 3, 2024
1 parent fa4b22b commit 290aea3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
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

0 comments on commit 290aea3

Please sign in to comment.