@html-validate/eslint-config-cypress 5.28.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.mjs +27 -15
  2. package/package.json +5 -5
  3. package/legacy.cjs +0 -14
package/index.mjs CHANGED
@@ -1,20 +1,32 @@
1
- import { fileURLToPath } from "node:url";
2
- import path from "node:path";
3
- import { FlatCompat } from "@eslint/eslintrc";
4
- import legacyConfig from "./legacy.cjs";
1
+ import eslintPluginCypress from "eslint-plugin-cypress/flat";
5
2
 
6
- const __filename = fileURLToPath(import.meta.url);
7
- const __dirname = path.dirname(__filename);
3
+ /**
4
+ * @typedef {import("eslint").Linter.Config} Config
5
+ */
8
6
 
9
- const compat = new FlatCompat({
10
- baseDirectory: __dirname,
11
- resolvePluginsRelativeTo: __dirname,
12
- });
7
+ /**
8
+ * @param {Config} config
9
+ * @returns {Config}
10
+ */
11
+ function defineConfig(config) {
12
+ return config;
13
+ }
13
14
 
14
- const migrated = compat.config(legacyConfig);
15
+ const recommended = eslintPluginCypress.configs.recommended;
15
16
 
16
- for (const ruleset of migrated) {
17
- ruleset.files = ["cypress/**/*.spec.[jt]s", "cypress/**/*.cy.[jt]s"];
18
- }
17
+ export default defineConfig({
18
+ languageOptions: {
19
+ ...recommended.languageOptions,
20
+ },
19
21
 
20
- export default migrated;
22
+ plugins: {
23
+ cypress: eslintPluginCypress,
24
+ },
25
+
26
+ rules: {
27
+ ...recommended.rules,
28
+
29
+ /* this rule triggers on basically every should(..) */
30
+ "sonarjs/no-duplicate-string": "off",
31
+ },
32
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-validate/eslint-config-cypress",
3
- "version": "5.28.0",
3
+ "version": "6.0.0",
4
4
  "description": "Eslint sharable config used by the various HTML-validate packages",
5
5
  "keywords": [
6
6
  "eslint",
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "license": "MIT",
19
19
  "author": "David Sveningsson <ext@sidvind.com>",
20
+ "type": "module",
20
21
  "main": "index.mjs",
21
22
  "files": [
22
23
  "*.cjs",
@@ -28,11 +29,10 @@
28
29
  "prepublishOnly": "release-prepublish --retain-scripts"
29
30
  },
30
31
  "dependencies": {
31
- "@eslint/eslintrc": "3.3.0",
32
- "eslint-plugin-cypress": "3.6.0"
32
+ "eslint-plugin-cypress": "4.2.0"
33
33
  },
34
34
  "peerDependencies": {
35
- "eslint": "^8.0.0"
35
+ "eslint": "^9.0.0"
36
36
  },
37
37
  "engines": {
38
38
  "node": ">= 20.9.0",
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "943b446e6793777ceb880c87aed74551789b2c4a"
44
+ "gitHead": "f54dcbae0ccae318895e34d32fbfa02b05cd38d1"
45
45
  }
package/legacy.cjs DELETED
@@ -1,14 +0,0 @@
1
- module.exports = {
2
- env: {
3
- "cypress/globals": true,
4
- },
5
-
6
- plugins: ["cypress"],
7
-
8
- extends: ["plugin:cypress/recommended"],
9
-
10
- rules: {
11
- /* this rule triggers on basically every should(..) */
12
- "sonarjs/no-duplicate-string": "off",
13
- },
14
- };