diff --git a/client/.eslintrc.js b/client/.eslintrc.js index 36a5955f5..dad9749d5 100644 --- a/client/.eslintrc.js +++ b/client/.eslintrc.js @@ -3,10 +3,16 @@ module.exports = { extends: [ 'next/core-web-vitals', 'plugin:@typescript-eslint/recommended', - 'plugin:prettier/recommended', 'plugin:import/recommended', 'plugin:import/typescript', + 'plugin:prettier/recommended', ], + parser: '@typescript-eslint/parser', + parserOptions: { + tsconfigRootDir: __dirname, + project: ['./tsconfig.eslint.json'], + }, + plugins: ['@typescript-eslint', 'prettier'], settings: { 'import/resolver': { typescript: true, diff --git a/client/.prettierrc.cjs b/client/.prettierrc.cjs new file mode 100644 index 000000000..048e029bb --- /dev/null +++ b/client/.prettierrc.cjs @@ -0,0 +1,10 @@ +/** @type {import("prettier").Options} */ +module.exports = { + semi: true, + tabWidth: 2, + printWidth: 100, + singleQuote: true, + trailingComma: 'all', + editorconfig: true, + plugins: ['prettier-plugin-tailwindcss'], +}; diff --git a/client/.prettierrc.json b/client/.prettierrc.json deleted file mode 100644 index c73b4c1b4..000000000 --- a/client/.prettierrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "semi": true, - "tabWidth": 2, - "printWidth": 100, - "singleQuote": true, - "trailingComma": "all", - "editorconfig": true -} diff --git a/client/next.config.js b/client/next.config.js index c0df00ee3..2b183b914 100644 --- a/client/next.config.js +++ b/client/next.config.js @@ -4,9 +4,6 @@ const nextConfig = { // ! the current approach we follow to handle layers on the map does not work with strict mode enabled, // ! do not enable it unless you know what you are doing or know the issue is fixed. reactStrictMode: false, - eslint: { - dirs: ['src'], - }, output: 'standalone', redirects() { return [ diff --git a/client/package.json b/client/package.json index 9a4553c86..eb3fb31aa 100644 --- a/client/package.json +++ b/client/package.json @@ -88,14 +88,15 @@ "cypress": "13.2.0", "eslint": "8.23.1", "eslint-config-next": "13.5.5", - "eslint-config-prettier": "8.6.0", + "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "3.6.1", "eslint-plugin-import": "^2.26.0", - "eslint-plugin-prettier": "4.2.1", + "eslint-plugin-prettier": "^5.1.2", "istanbul-reports": "3.0.0", "nyc": "15.1.0", "nyc-report-lcov-absolute": "1.0.0", - "prettier": "2.8.3", + "prettier": "^3.1.1", + "prettier-plugin-tailwindcss": "^0.5.10", "start-server-and-test": "1.14.0", "typescript": "5.2.2", "webpack": "5" diff --git a/client/tsconfig.eslint.json b/client/tsconfig.eslint.json new file mode 100644 index 000000000..a4abfcf5d --- /dev/null +++ b/client/tsconfig.eslint.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "include": ["**/*.ts", "**/*.tsx", "**/*.js", "./.eslintrc.js"] +} diff --git a/client/tsconfig.json b/client/tsconfig.json index 34a9782e1..8c5e76414 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "baseUrl": "./src", - "target": "es5", + "target": "ES2020", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, @@ -14,8 +14,26 @@ "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", - "incremental": true + "incremental": true, + "paths": { + "@/*": [ + "./*" + ], + "react": [ "./node_modules/@types/react" ] + }, + "plugins": [ + { + "name": "next" + } + ] }, - "include": ["*.d.ts", "src/**/*.ts", "src/**/*.tsx", "tailwind.config.js"], - "exclude": ["node_modules", ".storybook", "cypress"] + "include": [ + "next-env.d.ts", + "src/**/*.ts", + "src/**/*.tsx", + "src/**/*.d.ts", + "e2e/**/*.ts", + ".next/types/**/*.ts" + ], + "exclude": ["node_modules", ".next", "cypress"] } diff --git a/client/yarn.lock b/client/yarn.lock index fc7a4dfbe..cdab87e2a 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -1505,6 +1505,13 @@ __metadata: languageName: node linkType: hard +"@pkgr/core@npm:^0.1.0": + version: 0.1.0 + resolution: "@pkgr/core@npm:0.1.0" + checksum: eeff0e0e517b1ed10eb4c1a8971413a8349bbfdab727dbe7d4085fd94eab95f0c3beb51b9245fef30562849d2a7a119e07ca48c343c8c4ec4e64ee289f50fe5e + languageName: node + linkType: hard + "@pkgr/utils@npm:^2.3.1": version: 2.3.1 resolution: "@pkgr/utils@npm:2.3.1" @@ -4179,14 +4186,14 @@ __metadata: languageName: node linkType: hard -"eslint-config-prettier@npm:8.6.0": - version: 8.6.0 - resolution: "eslint-config-prettier@npm:8.6.0" +"eslint-config-prettier@npm:^9.1.0": + version: 9.1.0 + resolution: "eslint-config-prettier@npm:9.1.0" peerDependencies: eslint: ">=7.0.0" bin: eslint-config-prettier: bin/cli.js - checksum: ff0d0dfc839a556355422293428637e8d35693de58dabf8638bf0b6529131a109d0b2ade77521aa6e54573bb842d7d9d322e465dd73dd61c7590fa3834c3fa81 + checksum: 9229b768c879f500ee54ca05925f31b0c0bafff3d9f5521f98ff05127356de78c81deb9365c86a5ec4efa990cb72b74df8612ae15965b14136044c73e1f6a907 languageName: node linkType: hard @@ -4347,18 +4354,23 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-prettier@npm:4.2.1": - version: 4.2.1 - resolution: "eslint-plugin-prettier@npm:4.2.1" +"eslint-plugin-prettier@npm:^5.1.2": + version: 5.1.2 + resolution: "eslint-plugin-prettier@npm:5.1.2" dependencies: prettier-linter-helpers: ^1.0.0 + synckit: ^0.8.6 peerDependencies: - eslint: ">=7.28.0" - prettier: ">=2.0.0" + "@types/eslint": ">=8.0.0" + eslint: ">=8.0.0" + eslint-config-prettier: "*" + prettier: ">=3.0.0" peerDependenciesMeta: + "@types/eslint": + optional: true eslint-config-prettier: optional: true - checksum: b9e839d2334ad8ec7a5589c5cb0f219bded260839a857d7a486997f9870e95106aa59b8756ff3f37202085ebab658de382b0267cae44c3a7f0eb0bcc03a4f6d6 + checksum: ee972ca16c1d05773abe370dcd43c71ffe729ad4eca86752e21be3d4afbc18f04184b4143e9d17869395d534eb8ad685b7589fcdc2706cb734fe17c3c3f4e6cd languageName: node linkType: hard @@ -6495,10 +6507,10 @@ __metadata: date-fns: 2.22.1 eslint: 8.23.1 eslint-config-next: 13.5.5 - eslint-config-prettier: 8.6.0 + eslint-config-prettier: ^9.1.0 eslint-import-resolver-typescript: 3.6.1 eslint-plugin-import: ^2.26.0 - eslint-plugin-prettier: 4.2.1 + eslint-plugin-prettier: ^5.1.2 fuse.js: 6.4.6 istanbul-reports: 3.0.0 jsona: 1.9.2 @@ -6511,7 +6523,8 @@ __metadata: nyc-report-lcov-absolute: 1.0.0 pino: 8.1.0 postcss: 8.4.31 - prettier: 2.8.3 + prettier: ^3.1.1 + prettier-plugin-tailwindcss: ^0.5.10 query-string: 8.1.0 rc-tree: 5.7.0 react: 18.2.0 @@ -7952,12 +7965,63 @@ __metadata: languageName: node linkType: hard -"prettier@npm:2.8.3": - version: 2.8.3 - resolution: "prettier@npm:2.8.3" +"prettier-plugin-tailwindcss@npm:^0.5.10": + version: 0.5.11 + resolution: "prettier-plugin-tailwindcss@npm:0.5.11" + peerDependencies: + "@ianvs/prettier-plugin-sort-imports": "*" + "@prettier/plugin-pug": "*" + "@shopify/prettier-plugin-liquid": "*" + "@trivago/prettier-plugin-sort-imports": "*" + prettier: ^3.0 + prettier-plugin-astro: "*" + prettier-plugin-css-order: "*" + prettier-plugin-import-sort: "*" + prettier-plugin-jsdoc: "*" + prettier-plugin-marko: "*" + prettier-plugin-organize-attributes: "*" + prettier-plugin-organize-imports: "*" + prettier-plugin-style-order: "*" + prettier-plugin-svelte: "*" + peerDependenciesMeta: + "@ianvs/prettier-plugin-sort-imports": + optional: true + "@prettier/plugin-pug": + optional: true + "@shopify/prettier-plugin-liquid": + optional: true + "@trivago/prettier-plugin-sort-imports": + optional: true + prettier-plugin-astro: + optional: true + prettier-plugin-css-order: + optional: true + prettier-plugin-import-sort: + optional: true + prettier-plugin-jsdoc: + optional: true + prettier-plugin-marko: + optional: true + prettier-plugin-organize-attributes: + optional: true + prettier-plugin-organize-imports: + optional: true + prettier-plugin-style-order: + optional: true + prettier-plugin-svelte: + optional: true + prettier-plugin-twig-melody: + optional: true + checksum: 450646db10dbcec76fe6be7bfc85e2e3c6bd1a6c9026637fc9c7f9a0882d8adf6b6fb589be6d24e6a4868772d44b55278a3a39760aa9feee2cf281db9215c0f6 + languageName: node + linkType: hard + +"prettier@npm:^3.1.1": + version: 3.1.1 + resolution: "prettier@npm:3.1.1" bin: - prettier: bin-prettier.js - checksum: 92f2ceb522d454370e02082aa74ad27388672f7cee8975028b59517c069fe643bdc73e322675c8faf2ff173d7a626d1a6389f26b474000308e793aa25fff46e5 + prettier: bin/prettier.cjs + checksum: e386855e3a1af86a748e16953f168be555ce66d6233f4ba54eb6449b88eb0c6b2ca79441b11eae6d28a7f9a5c96440ce50864b9d5f6356d331d39d6bb66c648e languageName: node linkType: hard @@ -9555,6 +9619,16 @@ __metadata: languageName: node linkType: hard +"synckit@npm:^0.8.6": + version: 0.8.8 + resolution: "synckit@npm:0.8.8" + dependencies: + "@pkgr/core": ^0.1.0 + tslib: ^2.6.2 + checksum: 9ed5d33abb785f5f24e2531efd53b2782ca77abf7912f734d170134552b99001915531be5a50297aa45c5701b5c9041e8762e6cd7a38e41e2461c1e7fccdedf8 + languageName: node + linkType: hard + "tabbable@npm:^6.0.1": version: 6.0.1 resolution: "tabbable@npm:6.0.1" @@ -9896,6 +9970,13 @@ __metadata: languageName: node linkType: hard +"tslib@npm:^2.6.2": + version: 2.6.2 + resolution: "tslib@npm:2.6.2" + checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad + languageName: node + linkType: hard + "tunnel-agent@npm:^0.6.0": version: 0.6.0 resolution: "tunnel-agent@npm:0.6.0"