@fullstacksjs/eslint-config 11.0.0 → 11.1.1
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 +5 -4
- package/src/index.js +3 -0
- package/src/init.d.ts +2 -1
- package/src/modules/playwright.js +30 -0
- package/src/modules/tests.js +5 -0
- package/src/modules/typescript.js +12 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstacksjs/eslint-config",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.1.1",
|
|
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",
|
|
@@ -67,7 +68,7 @@
|
|
|
67
68
|
},
|
|
68
69
|
"peerDependencies": {
|
|
69
70
|
"cypress": ">=8",
|
|
70
|
-
"eslint": "
|
|
71
|
+
"eslint": "9",
|
|
71
72
|
"graphql": ">=15",
|
|
72
73
|
"prettier": "3",
|
|
73
74
|
"react": ">=16",
|
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,7 +14,8 @@ export interface Options {
|
|
|
14
14
|
cypress?: boolean;
|
|
15
15
|
storybook?: boolean;
|
|
16
16
|
prettier?: boolean;
|
|
17
|
-
|
|
17
|
+
playwright?: boolean;
|
|
18
|
+
typescript?: { projects: string[] | string | boolean; tsconfigRootDir?: string };
|
|
18
19
|
disableExpensiveRules?: boolean;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -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;
|
package/src/modules/tests.js
CHANGED
|
@@ -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
|
};
|
|
@@ -11,7 +11,17 @@ function typescript(options = {}) {
|
|
|
11
11
|
return {
|
|
12
12
|
files: [globs.ts, globs.tsx],
|
|
13
13
|
plugins: { '@typescript-eslint': plugin },
|
|
14
|
-
languageOptions: {
|
|
14
|
+
languageOptions: {
|
|
15
|
+
parser,
|
|
16
|
+
parserOptions: {
|
|
17
|
+
...predicate(options.typescript && options.typescript.projects, {
|
|
18
|
+
project: options.typescript.projects,
|
|
19
|
+
}),
|
|
20
|
+
...predicate(options.typescript && options.typescript.tsconfigRootDir, {
|
|
21
|
+
tsconfigRootDir: options.typescript.tsconfigRootDir,
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
15
25
|
rules: {
|
|
16
26
|
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
17
27
|
'@typescript-eslint/array-type': 'error',
|
|
@@ -175,7 +185,7 @@ function typescript(options = {}) {
|
|
|
175
185
|
}),
|
|
176
186
|
'@typescript-eslint/no-mixed-enums': 'error',
|
|
177
187
|
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
|
178
|
-
'@typescript-eslint/no-throw-literal': ['warn', { allowThrowingUnknown: false }],
|
|
188
|
+
// '@typescript-eslint/no-throw-literal': ['warn', { allowThrowingUnknown: false }],
|
|
179
189
|
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
|
|
180
190
|
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
|
|
181
191
|
'@typescript-eslint/no-unnecessary-condition': [
|