From 949a60290a1245bec777c85b7fc6a542461b3eaf Mon Sep 17 00:00:00 2001 From: zbeyens Date: Fri, 30 Aug 2024 02:56:04 +0200 Subject: [PATCH] config --- .../plate-playground-template/.eslintrc.js | 5 +- .../plate-playground-template/tsconfig.json | 64 +++++++++++++++---- templates/plate-template/.eslintrc.js | 5 +- templates/plate-template/tsconfig.json | 64 +++++++++++++++---- 4 files changed, 110 insertions(+), 28 deletions(-) diff --git a/templates/plate-playground-template/.eslintrc.js b/templates/plate-playground-template/.eslintrc.js index ab5dd5ccd4..db0f19178a 100644 --- a/templates/plate-playground-template/.eslintrc.js +++ b/templates/plate-playground-template/.eslintrc.js @@ -1,3 +1,4 @@ +const path = require('path'); const prettierConfig = require('./prettier.config.js'); module.exports = { @@ -11,7 +12,7 @@ module.exports = { plugins: ['tailwindcss', 'unused-imports', 'prettier'], rules: { '@next/next/no-html-link-for-pages': 'off', - 'prettier/prettier': ['warn', prettierConfig], + 'prettier/prettier': ['warn', { ...prettierConfig }], 'react/jsx-key': 'off', 'tailwindcss/classnames-order': 'warn', 'tailwindcss/no-custom-classname': 'error', @@ -30,7 +31,7 @@ module.exports = { settings: { tailwindcss: { callees: ['cn', 'cva', 'withCn'], - config: 'tailwind.config.js', + config: path.join(__dirname, './tailwind.config.js'), }, next: { rootDir: ['./'], diff --git a/templates/plate-playground-template/tsconfig.json b/templates/plate-playground-template/tsconfig.json index 7d6c87693b..b4e1596928 100644 --- a/templates/plate-playground-template/tsconfig.json +++ b/templates/plate-playground-template/tsconfig.json @@ -1,18 +1,45 @@ { "compilerOptions": { - "lib": ["dom", "dom.iterable", "esnext"], + "strict": false, + "strictNullChecks": true, + "allowUnusedLabels": false, + "allowUnreachableCode": false, + "exactOptionalPropertyTypes": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": false, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": false, + "noUnusedLocals": false, + "noUnusedParameters": false, + + "isolatedModules": true, + "allowJs": true, + "checkJs": false, + + "esModuleInterop": true, "skipLibCheck": true, - "strict": true, "forceConsistentCasingInFileNames": true, - "noEmit": true, - "incremental": true, - "esModuleInterop": true, + + "lib": ["dom", "dom.iterable", "esnext"], + "jsx": "preserve", "module": "esnext", - "moduleResolution": "node", + "target": "es2022", + "moduleResolution": "bundler", + "moduleDetection": "force", + "allowImportingTsExtensions": false, "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", + "noEmit": true, + "incremental": true, + "declaration": false, + "declarationMap": false, + "sourceMap": true, + "pretty": true, + "preserveWatchOutput": true, + + "tsBuildInfoFile": "tsconfig.tsbuildinfo", + "baseUrl": "src", "paths": { "@/*": ["./*"] @@ -21,10 +48,23 @@ { "name": "next" } - ], - "typeRoots": ["./node_modules/@types"], - "strictNullChecks": true + ] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": [ + "next-env.d.ts", + ".next/types/**/*.ts", + "src/**/*.ts", + "src/**/*.tsx", + "src/**/*.cts", + "src/**/*.ctsx", + "src/**/*.mts", + "src/**/*.mtsx", + "src/**/*.js", + "src/**/*.jsx", + "src/**/*.cjs", + "src/**/*.cjsx", + "src/**/*.mjs", + "src/**/*.mjsx" + ], "exclude": ["node_modules"] } diff --git a/templates/plate-template/.eslintrc.js b/templates/plate-template/.eslintrc.js index ab5dd5ccd4..db0f19178a 100644 --- a/templates/plate-template/.eslintrc.js +++ b/templates/plate-template/.eslintrc.js @@ -1,3 +1,4 @@ +const path = require('path'); const prettierConfig = require('./prettier.config.js'); module.exports = { @@ -11,7 +12,7 @@ module.exports = { plugins: ['tailwindcss', 'unused-imports', 'prettier'], rules: { '@next/next/no-html-link-for-pages': 'off', - 'prettier/prettier': ['warn', prettierConfig], + 'prettier/prettier': ['warn', { ...prettierConfig }], 'react/jsx-key': 'off', 'tailwindcss/classnames-order': 'warn', 'tailwindcss/no-custom-classname': 'error', @@ -30,7 +31,7 @@ module.exports = { settings: { tailwindcss: { callees: ['cn', 'cva', 'withCn'], - config: 'tailwind.config.js', + config: path.join(__dirname, './tailwind.config.js'), }, next: { rootDir: ['./'], diff --git a/templates/plate-template/tsconfig.json b/templates/plate-template/tsconfig.json index 7d6c87693b..b4e1596928 100644 --- a/templates/plate-template/tsconfig.json +++ b/templates/plate-template/tsconfig.json @@ -1,18 +1,45 @@ { "compilerOptions": { - "lib": ["dom", "dom.iterable", "esnext"], + "strict": false, + "strictNullChecks": true, + "allowUnusedLabels": false, + "allowUnreachableCode": false, + "exactOptionalPropertyTypes": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": false, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": false, + "noUnusedLocals": false, + "noUnusedParameters": false, + + "isolatedModules": true, + "allowJs": true, + "checkJs": false, + + "esModuleInterop": true, "skipLibCheck": true, - "strict": true, "forceConsistentCasingInFileNames": true, - "noEmit": true, - "incremental": true, - "esModuleInterop": true, + + "lib": ["dom", "dom.iterable", "esnext"], + "jsx": "preserve", "module": "esnext", - "moduleResolution": "node", + "target": "es2022", + "moduleResolution": "bundler", + "moduleDetection": "force", + "allowImportingTsExtensions": false, "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", + "noEmit": true, + "incremental": true, + "declaration": false, + "declarationMap": false, + "sourceMap": true, + "pretty": true, + "preserveWatchOutput": true, + + "tsBuildInfoFile": "tsconfig.tsbuildinfo", + "baseUrl": "src", "paths": { "@/*": ["./*"] @@ -21,10 +48,23 @@ { "name": "next" } - ], - "typeRoots": ["./node_modules/@types"], - "strictNullChecks": true + ] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": [ + "next-env.d.ts", + ".next/types/**/*.ts", + "src/**/*.ts", + "src/**/*.tsx", + "src/**/*.cts", + "src/**/*.ctsx", + "src/**/*.mts", + "src/**/*.mtsx", + "src/**/*.js", + "src/**/*.jsx", + "src/**/*.cjs", + "src/**/*.cjsx", + "src/**/*.mjs", + "src/**/*.mjsx" + ], "exclude": ["node_modules"] }