@fullstacksjs/eslint-config 11.0.0 → 11.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "11.0.0",
3
+ "version": "11.1.0",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -25,7 +25,6 @@
25
25
  "main": "src/index.js",
26
26
  "dependencies": {
27
27
  "@graphql-eslint/eslint-plugin": "3.20.1",
28
- "typescript-eslint": "rc-v8",
29
28
  "deepmerge": "4.3.1",
30
29
  "eslint-import-resolver-typescript": "3.6.1",
31
30
  "eslint-plugin-cypress": "3.3.0",
@@ -35,6 +34,7 @@
35
34
  "eslint-plugin-jest-formatting": "3.1.0",
36
35
  "eslint-plugin-jsx-a11y": "6.8.0",
37
36
  "eslint-plugin-n": "17.8.1",
37
+ "eslint-plugin-playwright": "1.6.2",
38
38
  "eslint-plugin-prettier": "5.1.3",
39
39
  "eslint-plugin-promise": "6.2.0",
40
40
  "eslint-plugin-react": "7.34.2",
@@ -42,7 +42,8 @@
42
42
  "eslint-plugin-storybook": "0.8.0",
43
43
  "eslint-plugin-tailwindcss": "3.17.3",
44
44
  "eslint-plugin-vitest": "0.5.4",
45
- "globals": "15.4.0"
45
+ "globals": "15.4.0",
46
+ "typescript-eslint": "rc-v8"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@eslint/eslintrc": "3.1.0",
package/src/index.js CHANGED
@@ -17,6 +17,7 @@ const strict = require('./modules/strict');
17
17
  const react = require('./modules/react');
18
18
  const storybook = require('./modules/storybook');
19
19
  const typescript = require('./modules/typescript');
20
+ const playwright = require('./modules/playwright');
20
21
 
21
22
  const testPackages = ['jest', 'vitest', 'cypress', 'playwright'];
22
23
 
@@ -40,6 +41,7 @@ const defaultOptions = {
40
41
  prettier: isPackageExists('prettier'),
41
42
  typescript: isPackageExists('typescript') ? { projects: true } : false,
42
43
  unocss: isPackageExists('unocss'),
44
+ playwright: isPackageExists('playwright'),
43
45
  };
44
46
 
45
47
  /**
@@ -71,6 +73,7 @@ function init(initOptions, ...extend) {
71
73
  if (options.react) rules.push(react(options));
72
74
  if (options.storybook) rules.push(storybook(options));
73
75
  if (options.typescript) rules.push(typescript(options));
76
+ if (options.playwright) rules.push(playwright(options));
74
77
 
75
78
  // ISSUE: Waiting for FlatConfig support https://github.com/dimaMachina/graphql-eslint/issues/2178
76
79
  // if (false && options.graphql) rules.push(graphql(options));
package/src/init.d.ts CHANGED
@@ -14,6 +14,7 @@ export interface Options {
14
14
  cypress?: boolean;
15
15
  storybook?: boolean;
16
16
  prettier?: boolean;
17
+ playwright?: boolean;
17
18
  typescript?: { projects: string[] | string };
18
19
  disableExpensiveRules?: boolean;
19
20
  }
@@ -0,0 +1,30 @@
1
+ const globals = require('globals');
2
+ const plugin = require('eslint-plugin-playwright');
3
+ const { globs } = require('../utils/globs');
4
+
5
+ /** @return { import('eslint').Linter.FlatConfig } */
6
+ function playwright() {
7
+ return {
8
+ plugins: { playwright: plugin },
9
+ files: globs.e2e,
10
+ rules: {
11
+ 'jest/no-standalone-expect': [
12
+ 'error',
13
+ {
14
+ additionalTestBlockFunctions: [
15
+ 'test.jestPlaywrightDebug',
16
+ 'it.jestPlaywrightDebug',
17
+ 'test.jestPlaywrightSkip',
18
+ 'it.jestPlaywrightSkip',
19
+ 'test.jestPlaywrightConfig',
20
+ 'it.jestPlaywrightConfig',
21
+ ],
22
+ },
23
+ ],
24
+ 'playwright/missing-playwright-await': 'error',
25
+ 'playwright/no-page-pause': 'warn',
26
+ },
27
+ };
28
+ }
29
+
30
+ module.exports = playwright;
@@ -1,6 +1,7 @@
1
1
  const plugin = require('eslint-plugin-jest-formatting');
2
2
  const { globs } = require('../utils/globs');
3
3
  const { predicate } = require('../utils/conditions');
4
+ const globals = require('globals');
4
5
 
5
6
  /**
6
7
  * @param {import('../init').Options} options
@@ -10,6 +11,9 @@ function tests(options = {}) {
10
11
  return {
11
12
  plugins: { 'jest-formatting': plugin },
12
13
  files: [...globs.test, ...globs.e2e],
14
+ languageOptions: {
15
+ globals: globals['shared-node-browser'],
16
+ },
13
17
  rules: {
14
18
  'jest-formatting/padding-around-after-all-blocks': 'warn',
15
19
  'jest-formatting/padding-around-after-each-blocks': 'warn',
@@ -35,6 +39,7 @@ function tests(options = {}) {
35
39
  '@typescript-eslint/no-namespace ': 'off',
36
40
  '@typescript-eslint/unbound-method': 'off',
37
41
  '@typescript-eslint/no-empty-function': 'off',
42
+ '@typescript-eslint/no-floating-promises': 'off',
38
43
  }),
39
44
  },
40
45
  };