I am new to Typescript universe. In my Playwright Typescript project, I just have eslint.config.mjs file. This file got created when I install eslint using npm init @eslint/config@latest
.
Then I just removed its contents and replaced it with the contents from:
https://www.npmjs.com/package/eslint-plugin-playwright
I don’t have any eslintignore file too.
My eslint.config.mjs file look like this:
<code>import playwright from 'eslint-plugin-playwright'
export default [
{
...playwright.configs['flat/recommended'],
files: ['test/**', 'src/**'],
},
{
files: ['test/**', 'src/**'],
rules: {
// Customize Playwright rules
// ...
},
},
]
</code>
<code>import playwright from 'eslint-plugin-playwright'
export default [
{
...playwright.configs['flat/recommended'],
files: ['test/**', 'src/**'],
},
{
files: ['test/**', 'src/**'],
rules: {
// Customize Playwright rules
// ...
},
},
]
</code>
import playwright from 'eslint-plugin-playwright'
export default [
{
...playwright.configs['flat/recommended'],
files: ['test/**', 'src/**'],
},
{
files: ['test/**', 'src/**'],
rules: {
// Customize Playwright rules
// ...
},
},
]
With this, when I run the command, am getting this warning and nothing is happening:
npx eslint test/MyTest.spec.ts
npx eslint test/MyTest.spec.ts
npx eslint test/MyTest.spec.ts
Warning:
/Users/user/IdeaProjects/automation/test/MyTest.spec.ts
0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to disable file ignore settings or use "--no-warn-ignored" to suppress this warning
✖ 1 problem (0 errors, 1 warning)
/Users/user/IdeaProjects/automation/test/MyTest.spec.ts
0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to disable file ignore settings or use "--no-warn-ignored" to suppress this warning
✖ 1 problem (0 errors, 1 warning)
/Users/user/IdeaProjects/automation/test/MyTest.spec.ts 0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to disable file ignore settings or use "--no-warn-ignored" to suppress this warning ✖ 1 problem (0 errors, 1 warning)
My dependency in package.json
file look like this:
"@eslint/js": "^8.57.0",
"@playwright/test": "^1.44.1",
"@types/node": "^20.14.2",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"eslint-plugin-playwright": "^1.6.2",
"globals": "^15.5.0",
"typescript": "^5.4.5",
"typescript-eslint": "^7.13.0"
"@eslint/js": "^8.57.0",
"@playwright/test": "^1.44.1",
"@types/node": "^20.14.2",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"eslint-plugin-playwright": "^1.6.2",
"globals": "^15.5.0",
"typescript": "^5.4.5",
"typescript-eslint": "^7.13.0"
"@eslint/js": "^8.57.0", "@playwright/test": "^1.44.1", "@types/node": "^20.14.2", "@typescript-eslint/eslint-plugin": "^7.13.0", "@typescript-eslint/parser": "^7.13.0", "dotenv": "^16.4.5", "eslint": "^8.57.0", "eslint-plugin-playwright": "^1.6.2", "globals": "^15.5.0", "typescript": "^5.4.5", "typescript-eslint": "^7.13.0"