Skip to content

Commit

Permalink
fix(eslint): provide default ignores when adding @o3r/eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu-crouzet committed Jan 8, 2025
1 parent 611b5b9 commit af41f0c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ describe('update eslint config', () => {
expect(tree.readText('eslint.local.config.mjs')).toContain(`${monorepoPkgName}/projects`);
expect(tree.readText('eslint.shared.config.mjs')).toContain(`${monorepoPkgName}/report-unused-disable-directives`);
expect(tree.readText('eslint.shared.config.mjs')).toContain(`${monorepoPkgName}/eslint-config`);
expect(tree.readText('eslint.shared.config.mjs')).toContain(`${monorepoPkgName}/ignores`);
});

it('should add an eslint config on an application', async () => {
Expand All @@ -81,6 +82,7 @@ describe('update eslint config', () => {
expect(tree.exists(`${libRoot}/tsconfig.eslint.json`)).toBeFalsy();
expect(tree.readText(`${appRoot}/eslint.config.mjs`)).toContain('import shared from \'../../eslint.shared.config.mjs\'');
expect(tree.readText(`${appRoot}/eslint.local.config.mjs`)).toContain(`${pckName}/projects`);
expect(tree.readText(`${appRoot}/eslint.local.config.mjs`)).toContain(`${pckName}/ignores`);
expect(tree.readText(`${appRoot}/eslint.local.config.mjs`)).toContain('...globals.browser');
expect(tree.readJson('angular.json')).toEqual({
...angularJsonContent,
Expand Down Expand Up @@ -115,6 +117,7 @@ describe('update eslint config', () => {
expect(tree.exists(`${appRoot}/tsconfig.eslint.json`)).toBeFalsy();
expect(tree.readText(`${libRoot}/eslint.config.mjs`)).toContain('import shared from \'../../eslint.shared.config.mjs\'');
expect(tree.readText(`${libRoot}/eslint.local.config.mjs`)).toContain(`${pckName}/projects`);
expect(tree.readText(`${libRoot}/eslint.local.config.mjs`)).toContain(`${pckName}/ignores`);
expect(tree.readText(`${libRoot}/eslint.local.config.mjs`)).not.toContain('...globals.browser');
expect(tree.readJson('angular.json')).toEqual({
...angularJsonContent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ const __dirname = dirname(__filename);
...globals.browser
}<% } %>
}
},
{
name: '<%= packageName %>/ignores',
ignores: []
}
];
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const o3rTemplate = require('@o3r/eslint-config/template');
reportUnusedDisableDirectives: 'error'
}
},
{
name: '<%= packageName %>/ignores',
ignores: []
},
{
name: '<%= packageName %>/settings',
settings: {
Expand Down

0 comments on commit af41f0c

Please sign in to comment.