Skip to content

Commit

Permalink
feat: adjust linter generator to use flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
Bielik20 committed Oct 10, 2024
1 parent 84e0332 commit c3ee99a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import {
GeneratorCallback,
joinPathFragments,
runTasksInSerial,
Tree,
updateJson,
} from '@nx/devkit';
import { Linter, lintProjectGenerator } from '@nx/eslint';
import { GeneratorCallback, joinPathFragments, runTasksInSerial, Tree } from '@nx/devkit';
import { lintProjectGenerator } from '@nx/eslint';
import { NxJestPlaywrightGeneratorNormalizedSchema } from './normalize-options';

export async function addLinting(
Expand All @@ -20,12 +14,5 @@ export async function addLinting(
skipFormat: true,
});

if (options.linter === Linter.EsLint) {
updateJson(host, joinPathFragments(options.projectRoot, '.eslintrc.json'), (json) => {
json.extends = [...json.extends];
return json;
});
}

return runTasksInSerial(lintTask);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import {
GeneratorCallback,
joinPathFragments,
runTasksInSerial,
Tree,
updateJson,
} from '@nx/devkit';
import { Linter, lintProjectGenerator } from '@nx/eslint';
import { GeneratorCallback, joinPathFragments, runTasksInSerial, Tree } from '@nx/devkit';
import { lintProjectGenerator } from '@nx/eslint';
import { ServerlessGeneratorNormalizedSchema } from './normalized-options';

export async function addLinting(
Expand All @@ -20,12 +14,5 @@ export async function addLinting(
skipFormat: true,
});

if (options.linter === Linter.EsLint) {
updateJson(host, joinPathFragments(options.projectRoot, '.eslintrc.json'), (json) => {
json.extends = [...json.extends];
return json;
});
}

return runTasksInSerial(lintTask);
}

0 comments on commit c3ee99a

Please sign in to comment.