Skip to content
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

chore: fix builds/tests/eslint #4780

Merged
merged 23 commits into from Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
@@ -0,0 +1 @@
.eslintrc.js
ThangHuuVu marked this conversation as resolved.
Show resolved Hide resolved
32 changes: 32 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,32 @@
const path = require('path')
Copy link
Member

Choose a reason for hiding this comment

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

I moved eslint config to here to use the path.resolve in parserOptions.project


module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
project: [
path.resolve(__dirname, './packages/**/tsconfig.eslint.json'),
Copy link
Member Author

Choose a reason for hiding this comment

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

Would be happy if this did not need to move out of package.json, but I see you are using path. I won't have strong feelings about it if there is no workaround. 🤔

Copy link
Member

@ThangHuuVu ThangHuuVu Sep 8, 2022

Choose a reason for hiding this comment

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

I moved it inside pacakge.json again! I thought missing path and __dirname was the problem but it turned out weren't
Nope, we still need it here for parserOptions.project to work 😂

],
tsconfigRootDir: __dirname
},
extends: [
"standard-with-typescript",
"prettier"
],
globals: {
localStorage: "readonly",
location: "readonly",
fetch: "readonly"
},
rules: {
"camelcase": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/restrict-template-expressions": "off"
},
"plugins": ["jest"],
"env": {
"jest/globals": true
}
}
64 changes: 9 additions & 55 deletions package.json
Expand Up @@ -6,9 +6,9 @@
"scripts": {
"build:app": "turbo run build --filter=next-auth-app --include-dependencies",
"build": "turbo run build --filter=next-auth --filter=@next-auth/* --no-deps",
"lint": "turbo run lint --filter=!next-auth-docs",
"lint": "turbo run lint --filter=!next-auth-docs --parallel",
"lint:fix": "turbo run lint -- --fix",
"test": "turbo run test --concurrency=1 --filter=!@next-auth/pouchdb-adapter --filter=!next-auth-* --filter=[HEAD^1]",
"test": "turbo run test --concurrency=1 --filter=!@next-auth/pouchdb-adapter --filter=!@next-auth/mikro-orm-adapter --filter=!@next-auth/upstash-redis-adapter --filter=!next-auth-* --filter=[HEAD^1]",
"setup": "turbo run setup",
"dev": "pnpm dev:app",
"email": "cd apps/dev && pnpm email",
Expand All @@ -20,25 +20,28 @@
"devDependencies": {
"@actions/core": "^1.6.0",
"@balazsorban/monorepo-release": "0.0.4",
"@types/jest": "^28.1.3",
"@types/node": "^17.0.25",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^4.33.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard-with-typescript": "^21.0.1",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^25.3.0",
"eslint-plugin-jest": "^27.0.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.0.0",
"husky": "^7.0.4",
"prettier": "2.4.1",
"pretty-quick": "^3.1.2",
"semver": "7.3.5",
"stream-to-array": "2.3.0",
"ts-node": "10.5.0",
"turbo": "1.3.1",
"typescript": "^4.5.2"
"typescript": "4.7.4"
},
"engines": {
"node": "^12.19.0 || ^14.15.0 || ^16.13.0",
"pnpm": ">=6.32.3"
"node": "^12.19.0 || ^14.15.0 || ^16.13.0"
},
"prettier": {
"semi": false,
Expand All @@ -52,55 +55,6 @@
}
]
},
"eslintConfig": {
"parser": "@typescript-eslint/parser",
"extends": [
"standard-with-typescript",
"prettier"
],
"ignorePatterns": [
"node_modules",
"next-env.d.ts",
"types",
".next",
"dist",
"/core",
"/react.js"
],
"globals": {
"localStorage": "readonly",
"location": "readonly",
"fetch": "readonly"
},
"rules": {
"camelcase": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/restrict-template-expressions": "off"
},
"overrides": [
{
"files": [
"./**/*test.js"
],
"env": {
"jest/globals": true
},
"extends": [
"plugin:jest/recommended"
],
"plugins": [
"jest"
]
}
]
},
"eslintIgnore": [
"./*.d.ts",
"**/tests",
"**/__tests__"
],
"packageManager": "pnpm@7.5.1",
"funding": [
{
Expand Down
8 changes: 8 additions & 0 deletions packages/adapter-dgraph/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
2 changes: 1 addition & 1 deletion packages/adapter-dgraph/tsconfig.json
@@ -1,5 +1,5 @@
{
"extends": "@next-auth/tsconfig/adapters.json",
"extends": "@next-auth/tsconfig/tsconfig.adapters.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
Expand Down
8 changes: 8 additions & 0 deletions packages/adapter-dynamodb/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
2 changes: 1 addition & 1 deletion packages/adapter-dynamodb/tsconfig.json
@@ -1,5 +1,5 @@
{
"extends": "@next-auth/tsconfig/adapters.json",
"extends": "@next-auth/tsconfig/tsconfig.adapters.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
Expand Down
8 changes: 8 additions & 0 deletions packages/adapter-fauna/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
2 changes: 1 addition & 1 deletion packages/adapter-fauna/tsconfig.json
@@ -1,5 +1,5 @@
{
"extends": "@next-auth/tsconfig/adapters.json",
"extends": "@next-auth/tsconfig/tsconfig.adapters.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
Expand Down
8 changes: 8 additions & 0 deletions packages/adapter-firebase/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
5 changes: 3 additions & 2 deletions packages/adapter-firebase/tsconfig.json
@@ -1,10 +1,11 @@
{
"extends": "@next-auth/tsconfig/adapters.json",
"extends": "@next-auth/tsconfig/tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"strict": true,
"noUncheckedIndexedAccess": true
"noUncheckedIndexedAccess": true,
"moduleResolution": "node"
},
"exclude": ["tests", "dist", "jest.config.js"]
}
8 changes: 8 additions & 0 deletions packages/adapter-mikro-orm/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
2 changes: 1 addition & 1 deletion packages/adapter-mikro-orm/tsconfig.json
@@ -1,5 +1,5 @@
{
"extends": "@next-auth/tsconfig/adapters.json",
"extends": "@next-auth/tsconfig/tsconfig.adapters.json",
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
Expand Down
8 changes: 8 additions & 0 deletions packages/adapter-mongodb/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
2 changes: 1 addition & 1 deletion packages/adapter-mongodb/tsconfig.json
@@ -1,5 +1,5 @@
{
"extends": "@next-auth/tsconfig/adapters.json",
"extends": "@next-auth/tsconfig/tsconfig.adapters.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
Expand Down
8 changes: 8 additions & 0 deletions packages/adapter-neo4j/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
2 changes: 1 addition & 1 deletion packages/adapter-neo4j/tsconfig.json
@@ -1,5 +1,5 @@
{
"extends": "@next-auth/tsconfig/adapters.json",
"extends": "@next-auth/tsconfig/tsconfig.adapters.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
Expand Down
8 changes: 8 additions & 0 deletions packages/adapter-pouchdb/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
2 changes: 1 addition & 1 deletion packages/adapter-pouchdb/tsconfig.json
@@ -1,5 +1,5 @@
{
"extends": "@next-auth/tsconfig/base.json",
"extends": "@next-auth/tsconfig/tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
Expand Down
8 changes: 8 additions & 0 deletions packages/adapter-prisma/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
2 changes: 1 addition & 1 deletion packages/adapter-prisma/tsconfig.json
@@ -1,5 +1,5 @@
{
"extends": "@next-auth/tsconfig/adapters.json",
"extends": "@next-auth/tsconfig/tsconfig.adapters.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
Expand Down
8 changes: 8 additions & 0 deletions packages/adapter-sequelize/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
2 changes: 1 addition & 1 deletion packages/adapter-sequelize/tsconfig.json
@@ -1,5 +1,5 @@
{
"extends": "@next-auth/tsconfig/adapters.json",
"extends": "@next-auth/tsconfig/tsconfig.adapters.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
Expand Down
8 changes: 8 additions & 0 deletions packages/adapter-typeorm-legacy/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
2 changes: 1 addition & 1 deletion packages/adapter-typeorm-legacy/tsconfig.json
@@ -1,5 +1,5 @@
{
"extends": "@next-auth/tsconfig/adapters.json",
"extends": "@next-auth/tsconfig/tsconfig.adapters.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
Expand Down
8 changes: 8 additions & 0 deletions packages/adapter-upstash-redis/tsconfig.eslint.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"],
"exclude": [
"./*.js",
"./*.d.ts",
]
}
2 changes: 1 addition & 1 deletion packages/adapter-upstash-redis/tsconfig.json
@@ -1,5 +1,5 @@
{
"extends": "@next-auth/tsconfig/adapters.json",
"extends": "@next-auth/tsconfig/tsconfig.adapters.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
Expand Down
19 changes: 5 additions & 14 deletions packages/next-auth/package.json
Expand Up @@ -39,14 +39,15 @@
"scripts": {
"build": "pnpm clean && pnpm build:js && pnpm build:css",
"clean": "rm -rf client css utils providers core jwt react next index.d.ts index.js adapters.d.ts middleware.d.ts middleware.js",
"build:js": "pnpm clean && pnpm generate-providers && tsc && babel --config-file ./config/babel.config.js src --out-dir . --extensions \".tsx,.ts,.js,.jsx\"",
"build:types": "tsc --project tsconfig.json",
"build:js": "pnpm clean && pnpm generate-providers && pnpm build:types && babel --config-file ./config/babel.config.js src --out-dir . --extensions \".tsx,.ts,.js,.jsx\"",
"build:css": "postcss --config config/postcss.config.js src/**/*.css --base src --dir . && node config/wrap-css.js",
"watch:css": "postcss --config config/postcss.config.js --watch src/**/*.css --base src --dir .",
"test": "jest --config ./config/jest.config.js",
"prepublishOnly": "pnpm build",
"generate-providers": "node ./config/generate-providers.js",
"setup": "pnpm generate-providers",
"lint": "eslint src config"
"lint": "eslint src config tests"
},
"files": [
"lib",
Expand Down Expand Up @@ -94,7 +95,7 @@
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@next-auth/tsconfig": "workspace:^0.0.0",
"@next-auth/tsconfig": "workspace:*",
"@swc/core": "^1.2.198",
"@swc/jest": "^0.2.21",
"@testing-library/dom": "^8.13.0",
Expand Down Expand Up @@ -126,15 +127,5 @@
},
"engines": {
"node": "^12.19.0 || ^14.15.0 || ^16.13.0"
},
"eslintConfig": {
"parserOptions": {
"project": "./tsconfig.eslint.json"
}
},
"eslintIgnore": [
"./*.d.ts",
"**/tests",
"**/__tests__"
]
}
}