Skip to content

Commit

Permalink
fix: jasmine eslint config conflicts with e2e
Browse files Browse the repository at this point in the history
- specify `src/**/*.spec.ts` files to prevent conflict with e2e
- update playwright eslint example to mjs import
  • Loading branch information
joematthews committed Jan 18, 2025
1 parent 225c142 commit e7fe703
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,12 @@ Angular has schematics available for several end to end testing frameworks. The
The [eslint-plugin-playwright](https://github.com/playwright-community/eslint-plugin-playwright) package has rules for the popular [Playwright](https://playwright.dev/) framework. To incorporate these rules, import the plugin in the [eslint.config.js](eslint.config.js) file and then add a new config object that targets `e2e/**/*.spec.ts` files:

```js
const playwright = require("eslint-plugin-playwright");
import { playwright } from 'eslint-plugin-playwright';
...
{
files: ["e2e/**/*.spec.ts"],
extends: [...playwright.configs["flat/recommended"], eslintConfigPrettier],
rules: { ...playwright.configs["flat/recommended"].rules },
files: ['e2e/**/*.spec.ts'],
extends: [...playwright.configs['flat/recommended'], prettierConfig],
rules: { ...playwright.configs['flat/recommended'].rules },
},
}
```
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default config(
rules: {},
},
{
files: ['**/*.spec.ts'],
files: ['src/**/*.spec.ts'],
extends: [jasminePlugin.configs.recommended, prettierConfig],
languageOptions: {
globals: {
Expand Down

0 comments on commit e7fe703

Please sign in to comment.