Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c49c39a

Browse files
authoredJan 31, 2022
refactor: Update test environments and lint configuration (#1736)
* Update test environments and lint configuration Update Jest (unit + integration) and Playwright (e2e) test environments. Includes stability improvements for e2e tests using newer, more stable methods per the Playwright docs. - Update Jest 26 => 27 - Update Jest-related libs (babel parser) - Update Playwright 1.8 => Playwright Test 1.18 - Update GitHub CI (action versions, job parallelization, and matrices) - Update ESLint 5 => 8 - Update ESLint-related libs (parser, prettier, Jest, Playwright) - Fix test failures on M1-based Macs - Fix e2e stability issues by replacing PW $ method calls - Fix ESLint errors - Fix incorrect CI flag on Jest runs (-ci => --ci) - Refactor e2e test runner from Jest to Playwright Test - Refactor e2e test files for Playwright Test - Refactor fix-lint script name to lint:fix for consistency - Refactor npm scripts order for readability - Remove unnecessary configs and libs - Remove example image snapshots
1 parent b58941e commit c49c39a

File tree

72 files changed

+33147
-9394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+33147
-9394
lines changed
 

‎.eslintignore

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
.git
2-
packages/docsify-server-renderer/build.js
3-
node_modules
2+
**/*.md
43
build
5-
server.js
4+
docs
65
lib
6+
node_modules
7+
packages/docsify-server-renderer/build.js
8+
server.js
79
themes
8-
build
9-
docs/
10-
**/*.md

‎.eslintrc.js

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1+
const prettierConfig = require('./.prettierrc');
2+
13
module.exports = {
24
root: true,
3-
parser: 'babel-eslint',
5+
extends: [
6+
'eslint:recommended',
7+
'plugin:import/recommended',
8+
'plugin:prettier/recommended', // Must be last
9+
],
10+
parser: '@babel/eslint-parser',
411
parserOptions: {
512
sourceType: 'module',
613
ecmaVersion: 2019,
714
},
15+
plugins: ['prettier', 'import'],
816
env: {
917
browser: true,
10-
node: true,
1118
es6: true,
19+
node: true,
1220
},
13-
plugins: ['prettier', 'import'],
14-
extends: ['eslint:recommended', 'plugin:import/recommended'],
1521
settings: {
1622
'import/ignore': ['node_modules', '.json$'],
1723
},
1824
rules: {
19-
'prettier/prettier': ['error'],
2025
camelcase: ['warn'],
21-
'no-useless-escape': ['warn'],
2226
curly: ['error', 'all'],
2327
'dot-notation': ['error'],
2428
eqeqeq: ['error'],
@@ -33,9 +37,16 @@ module.exports = {
3337
'no-proto': ['error'],
3438
'no-return-assign': ['error'],
3539
'no-self-compare': ['error'],
36-
'no-shadow': ['warn'],
3740
'no-shadow-restricted-names': ['error'],
41+
'no-shadow': [
42+
'error',
43+
{
44+
allow: ['Events', 'Fetch', 'Lifecycle', 'Render', 'Router'],
45+
},
46+
],
47+
'no-unused-vars': ['error', { args: 'none' }],
3848
'no-useless-call': ['error'],
49+
'no-useless-escape': ['warn'],
3950
'no-var': ['error'],
4051
'no-void': ['error'],
4152
'no-with': ['error'],
@@ -46,18 +57,21 @@ module.exports = {
4657

4758
// Import rules
4859
// Search way how integrate with `lerna`
49-
'import/no-unresolved': 'off',
5060
'import/imports-first': ['error'],
5161
'import/newline-after-import': ['error'],
5262
'import/no-duplicates': ['error'],
5363
'import/no-mutable-exports': ['error'],
54-
'import/no-named-as-default': ['error'],
5564
'import/no-named-as-default-member': ['error'],
65+
'import/no-named-as-default': ['error'],
66+
'import/no-unresolved': 'off',
5667
'import/order': ['warn'],
68+
69+
// Prettier (Must be last)
70+
'prettier/prettier': ['warn', prettierConfig],
5771
},
5872
globals: {
59-
Docsify: 'writable',
6073
$docsify: 'writable',
74+
Docsify: 'writable',
6175
dom: 'writable',
6276
},
6377
};

1 commit comments

Comments
 (1)
Please sign in to comment.