Skip to content

chore: enable ESLint on test folder #2076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.next
node_modules
test
lib
demos
packages/runtime/src/templates/edge
packages/runtime/src/templates/edge-shared
packages/runtime/lib
packages/runtime/dist-types
jestSetup.js
jestSetup.js
test/e2e
test/fixtures/broken_next_config/next.config.js

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dust] since we're updating this add a new line that's missing:

23 changes: 23 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,28 @@ module.exports = {
'promise/catch-or-return': 0,
},
},
{
files: ['test/**', 'packages/**/test/**'],
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
rules: {
// Disable global rules
'max-nested-callbacks': 'off',
'@typescript-eslint/no-empty-function': 0,
'max-lines-per-function': 0,
'unicorn/no-empty-file': 0,
'prefer-destructuring': 0,
'@typescript-eslint/no-unused-vars': 0,
'unicorn/no-await-expression-member': 0,
'import/no-anonymous-default-export': 0,
'no-shadow': 0,
'@typescript-eslint/no-var-requires': 0,
'require-await': 0,
// esling-plugin-jest specific rules
'jest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],
'jest/no-disabled-tests': 0,
'jest/no-conditional-expect': 0,
},
},
],
}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ node_modules
lib
tsconfig.json
demos/nx-next-monorepo-demo
test/fixtures/broken_next_config/next.config.js
test/e2e

**/CHANGELOG.md
packages/runtime/lib
Expand Down
164 changes: 128 additions & 36 deletions package-lock.json

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

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"test:update": "run-s build build:demo test:jest:update"
},
"config": {
"eslint": "--cache --format=codeframe --max-warnings=0 \"{packages,src,scripts,tests,.github}/**/*.{ts,js,md,html}\" \"*.{ts,js,md,html}\" \".*.{ts,js,md,html}\"",
"prettier": "--loglevel=warn \"{packages,src,scripts,tests,.github}/**/*.{ts,js,md,yml,json,html}\" \"*.{ts,js,yml,json,html}\" \".*.{ts,js,yml,json,html}\" \"!package-lock.json\""
"eslint": "--cache --format=codeframe --max-warnings=0 \"{packages,test,.github}/**/*.{ts,js,md,html}\" \"*.{ts,js,md,html}\" \".*.{ts,js,md,html}\"",
"prettier": "--loglevel=warn \"{packages,test,.github}/**/*.{ts,js,md,yml,json,html}\" \"*.{ts,js,yml,json,html}\" \".*.{ts,js,yml,json,html}\" \"!package-lock.json\""
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -67,9 +67,11 @@
"cypress": "^12.10.0",
"escape-string-regexp": "^2.0.0",
"eslint-config-next": "^12.0.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-unicorn": "^43.0.2",
"execa": "^5.1.1",
"fs-extra": "^11.1.1",
"husky": "^7.0.4",
"jest": "^27.0.0",
"jest-extended": "^3.2.0",
Expand All @@ -78,6 +80,8 @@
"mock-fs": "^5.2.0",
"netlify-plugin-cypress": "^2.2.1",
"npm-run-all": "^4.1.5",
"outdent": "^0.8.0",
"pathe": "^1.1.0",
"playwright-chromium": "1.28.1",
"prettier": "^2.1.2",
"react": "^18.2.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
],
"devDependencies": {
"@netlify/edge-functions": "^2.0.0",
"@types/chance": "^1.1.3",
"@types/node": "^17.0.25",
"chance": "^1.1.11",
"next": "^13.3.0",
"npm-run-all": "^4.1.5",
"typescript": "^4.6.3"
Expand Down
Loading