@@ -13,15 +13,15 @@ import typescriptEslint, { configs as tsConfigs } from "typescript-eslint";
1313import js from "@eslint/js" ;
1414import comments from "@eslint-community/eslint-plugin-eslint-comments/configs" ;
1515import { flatConfigs as importPluginConfig } from "eslint-plugin-import" ;
16- import pluginCypress from "eslint-plugin-cypress/flat " ;
16+ import playwright from "eslint-plugin-playwright " ;
1717
18- // This helper `config()` function replaces the basic [] used by
18+ // This helper `config()` function replaces the basic [] used by
1919// eslint normally:
2020// https://typescript-eslint.io/packages/typescript-eslint#config
2121export default typescriptEslint . config (
2222 {
2323 name : "ignore dist and node_modules" ,
24- ignores : [ "dist/" , "node_modules/" , ".vscode/" , "old.*" ]
24+ ignores : [ "dist/" , "node_modules/" , ".vscode/" , "old.*" ]
2525 } ,
2626 js . configs . recommended ,
2727 tsConfigs . recommended ,
@@ -84,8 +84,8 @@ export default typescriptEslint.config(
8484 "eqeqeq" : [ "error" , "smart" ] ,
8585 "@eslint-community/eslint-comments/no-unused-disable" : "off" , // enabled in eslint.build.config.mjs
8686 // Note: this has caused slowdowns in large projects
87- "import/no-cycle" : "warn" ,
88- // Note: this has caused problems with overridden or aliased dependencies
87+ "import/no-cycle" : "warn" ,
88+ // Note: this has caused problems with overridden or aliased dependencies
8989 // like the Concord mobx-state-tree override
9090 "import/no-extraneous-dependencies" : "warn" ,
9191 "import/no-useless-path-segments" : "warn" ,
@@ -99,7 +99,7 @@ export default typescriptEslint.config(
9999 "no-tabs" : "error" ,
100100 "no-unneeded-ternary" : "error" ,
101101 // there is a recommended typescript rule for this too, so this might be redundant
102- "no-unused-expressions" : [ "error" , { allowShortCircuit : true } ] ,
102+ "no-unused-expressions" : [ "error" , { allowShortCircuit : true } ] ,
103103 "no-unused-vars" : "off" , // superseded by @typescript -eslint/no-unused-vars
104104 "no-useless-call" : "error" ,
105105 "no-useless-concat" : "error" ,
@@ -128,10 +128,10 @@ export default typescriptEslint.config(
128128 } ,
129129 // The projectService is required to use the @typescript -eslint/prefer-optional-chain rule
130130 // The projectService does not work well with files that aren't configured by a tsconfig.json
131- // file, so we only apply it to the files in src and cypress .
131+ // file, so we only apply it to the files in src and playwright .
132132 {
133- name : "rules only for project and cypress typescript files" ,
134- files : [ "src/**/*.ts" , "src/**/*.tsx" , "cypress /**/*.ts" , "cypress /**/*.tsx" ] ,
133+ name : "rules only for project and playwright typescript files" ,
134+ files : [ "src/**/*.ts" , "src/**/*.tsx" , "playwright /**/*.ts" , "playwright /**/*.tsx" ] ,
135135 languageOptions : {
136136 parserOptions : {
137137 projectService : true ,
@@ -163,40 +163,35 @@ export default typescriptEslint.config(
163163 "jest/no-done-callback" : "off"
164164 }
165165 } ,
166- {
167- name : "rules specific to Cypress tests" ,
168- files : [ "cypress/**" ] ,
169- extends : [
170- pluginCypress . configs . recommended
171- ] ,
166+ {
167+ ...playwright . configs [ "flat/recommended" ] ,
168+ name : "rules specific to Playwright tests" ,
169+ files : [ "playwright/**" ] ,
172170 rules : {
173- "@typescript-eslint/no-require-imports" : "off" ,
174- "@typescript-eslint/no-non-null-assertion" : "off" ,
175- "@typescript-eslint/no-var-requires" : "off" ,
176- "cypress/no-unnecessary-waiting" : "off"
171+ ...playwright . configs [ "flat/recommended" ] . rules
177172 }
178173 } ,
179174 {
180175 name : "json files" ,
181176 files : [ "**/*.json" ] ,
182177 ...json . configs . recommended
183178 } ,
184- {
179+ {
185180 name : "eslint configs" ,
186181 files : [ "eslint.*.mjs" ] ,
187182 languageOptions : {
188183 globals : {
189184 ...globals . node
190- } ,
185+ } ,
191186 } ,
192- } ,
187+ } ,
193188 {
194189 name : "webpack configs" ,
195190 files : [ "webpack.config.js" ] ,
196191 languageOptions : {
197192 globals : {
198193 ...globals . node
199- } ,
194+ } ,
200195 } ,
201196 rules : {
202197 "@typescript-eslint/no-require-imports" : "off" ,
@@ -210,7 +205,7 @@ export default typescriptEslint.config(
210205 languageOptions : {
211206 globals : {
212207 ...globals . node
213- } ,
208+ } ,
214209 } ,
215210 rules : {
216211 "@typescript-eslint/no-require-imports" : "off" ,
0 commit comments