Skip to content

Commit

Permalink
Merge branch 'canary' into brody/add-vitest-config
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmckeb authored Mar 5, 2024
2 parents a8a63be + d39b95f commit 2fb4b4f
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 47 deletions.
2 changes: 1 addition & 1 deletion eslint/browser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: require.resolve('./_base'),
extends: './_base',
env: {
browser: true,
},
Expand Down
9 changes: 5 additions & 4 deletions eslint/playwright-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
extends: [
'plugin:playwright/playwright-test',
require.resolve('./rules/playwright-test.js'),
],
plugins: ['playwright'],
extends: [require.resolve('./rules/playwright-test.js')],
env: {
'shared-node-browser': true,
},
};
6 changes: 0 additions & 6 deletions eslint/rules/best-practice.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,6 @@ module.exports = {
* 🚫 Not fixable - https://eslint.org/docs/rules/no-return-assign
*/
'no-return-assign': 'error',
/**
* Disallows unnecessary `return await`.
*
* 🚫 Not fixable - https://eslint.org/docs/rules/no-return-await
*/
'no-return-await': 'error',
/**
* Disallow use of `javascript:` urls.
*
Expand Down
6 changes: 0 additions & 6 deletions eslint/rules/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,5 @@ module.exports = {
* 🔧 Fixable - https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-lowercase-title.md
*/
'jest/prefer-lowercase-title': 'warn',
/**
* Require test cases and hooks to be inside a `describe` block.
*
* 🚫 Not fixable - https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-top-level-describe.md
*/
'jest/require-top-level-describe': 'error',
},
};
15 changes: 8 additions & 7 deletions eslint/rules/playwright-test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Source: https://github.com/playwright-community/eslint-plugin-playwright/blob/main/src/index.ts
// Source: https://github.com/playwright-community/eslint-plugin-playwright/blob/v1.5.1/src/index.ts#L101-L129
const recommended = {
'no-empty-pattern': 'off',
'playwright/expect-expect': 'warn',
'playwright/max-nested-describe': 'warn',
'playwright/missing-playwright-await': 'error',
'playwright/no-conditional-expect': 'warn',
'playwright/no-conditional-in-test': 'warn',
'playwright/no-element-handle': 'warn',
'playwright/no-eval': 'warn',
Expand All @@ -13,11 +14,17 @@ const recommended = {
'playwright/no-networkidle': 'error',
'playwright/no-page-pause': 'warn',
'playwright/no-skipped-test': 'warn',
'playwright/no-standalone-expect': 'error',
'playwright/no-unsafe-references': 'error',
'playwright/no-useless-await': 'warn',
'playwright/no-useless-not': 'warn',
'playwright/no-wait-for-selector': 'warn',
'playwright/no-wait-for-timeout': 'warn',
'playwright/prefer-web-first-assertions': 'error',
'playwright/valid-describe-callback': 'error',
'playwright/valid-expect': 'error',
'playwright/valid-expect-in-promise': 'error',
'playwright/valid-title': 'error',
};

module.exports = {
Expand All @@ -35,11 +42,5 @@ module.exports = {
* 🔧 Fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
*/
'playwright/prefer-to-have-length': 'warn',
/**
* Require test cases and hooks to be inside a `test.describe` block.
*
* 🚫 Not fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
*/
'playwright/require-top-level-describe': 'error',
},
};
6 changes: 0 additions & 6 deletions eslint/rules/possible-errors.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
module.exports = {
rules: {
/**
* Disallow await inside of loops.
*
* 🚫 Not fixable - https://eslint.org/docs/rules/no-await-in-loop
*/
'no-await-in-loop': 'error',
/**
* Disallow the use of console.
*
Expand Down
6 changes: 0 additions & 6 deletions eslint/rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ module.exports = {
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
*/
'react/jsx-pascal-case': 'warn',
/**
* Require props to be sorted alphabetically.
*
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
*/
'react/jsx-sort-props': 'warn',
/**
* Disallow usage of Array index in keys.
*
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vercel/style-guide",
"version": "5.3.0-canary.1",
"version": "5.3.0-canary.6",
"description": "Vercel's engineering style guide",
"homepage": "https://github.com/vercel/style-guide#readme",
"bugs": {
Expand Down Expand Up @@ -49,7 +49,7 @@
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-playwright": "^0.16.0",
"eslint-plugin-playwright": "^1.5.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-testing-library": "^6.0.1",
Expand Down
27 changes: 18 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2fb4b4f

Please sign in to comment.