Skip to content

Commit

Permalink
chore: set new eslint config + deactive lint-staged + remove commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
wazolab committed Jan 16, 2024
1 parent 6bf700b commit 73e5b84
Show file tree
Hide file tree
Showing 12 changed files with 1,029 additions and 1,587 deletions.
55 changes: 0 additions & 55 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
# yarn commitlint --edit $1
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
# yarn lint-staged
13 changes: 9 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"recommendations": [
"vue.volar",
"dbaeumer.vscode-eslint"
]
"recommendations": [
"vue.volar",
"dbaeumer.vscode-eslint"
],
"unwantedRecommendations": [
"vscode.typescript-language-features",
"octref.vetur",
"vue.vscode-typescript-vue-plugin"
]
}
2 changes: 1 addition & 1 deletion bin/build-config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import vidos from '../vidos.config'

import { VidoConfig } from '~/utils/types-config'
import type { VidoConfig } from '~/utils/types-config'

const vidoHostConfig: { [key: string]: VidoConfig } = {}
Object.values(vidos).forEach((vido) => {
Expand Down
3 changes: 0 additions & 3 deletions commitlint.config.js

This file was deleted.

File renamed without changes.
9 changes: 9 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import antfu from '@antfu/eslint-config'

export default antfu(
{
rules: {
'node/prefer-global/process': 0,
},
},
)
25 changes: 12 additions & 13 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default defineNuxtConfig({
useCookie: false,
},
experimental: {
jsTsFormatResource: true
jsTsFormatResource: true,
},
langDir: 'locales',
lazy: true,
Expand All @@ -52,7 +52,7 @@ export default defineNuxtConfig({
{ code: 'fr', name: 'Français', flag: 'FR', iso: 'fr-FR', file: 'fr-FR.ts' },
],
strategy: 'no_prefix',
vueI18n: 'i18n.config.ts'
vueI18n: 'config/i18n.config.ts',
},
image: {
domains: [...configuredApi(vidos), ...configuredImageProxy(vidos)],
Expand All @@ -67,15 +67,14 @@ export default defineNuxtConfig({
// process.env.SENTRY_DSN ? ['@nuxtjs/sentry'] : [],
'@pinia/nuxt',
async (options, nuxt) => {
nuxt.hooks.hook('vite:extendConfig', (config) =>
// @ts-ignore
config.plugins.push(vuetify())
)
nuxt.hooks.hook('vite:extendConfig', config =>
// @ts-expect-error: Do we really need to extend the config ?
config.plugins.push(vuetify()))
},
],
runtimeConfig: {
public: {
// @ts-ignore
// @ts-expect-error: Bad pratice, make it the Nuxt way (https://nuxt.com/docs/guide/going-further/runtime-config)
vidos: vidos.__publicRuntimeConfig__ ? vidos : undefined,
cypress: process.env.CYPRESS,
},
Expand Down Expand Up @@ -110,26 +109,26 @@ export default defineNuxtConfig({
host: '0.0.0.0',
},
typescript: {
shim: false
shim: false,
},
vite: {
optimizeDeps: { exclude: ['fsevents'] },
},
watchers: {
chokidar: {
// @ts-ignore
ignor: (f) =>
// @ts-expect-error: Not sure these watchers are useful
ignor: f =>
[
/\.git/,
/\.yarn/,
/cypress/,
/.*\.story\.vue$/,
/\.nuxt\/dist\/server\//,
].some((r) => r.test(f)),
].some(r => r.test(f)),
},
webpack: {
// @ts-ignore
// @ts-expect-error: Not sure webpack is usefull as we are using Vite
ignored: /\.git|\.yarn|cypress|.*\.story\.vue$|\.nuxt\/dist\/server\//,
},
}
},
})
16 changes: 4 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@teritorio/vido",
"type": "module",
"version": "1.21.0",
"private": true,
"engines": {
"node": ">= 18.0.0 < 20.0.0"
},
"scripts": {
"prepare": "yarn nuxi prepare",
"build-config": "npx ts-node -O '{\"module\": \"commonjs\"}' bin/build-config.ts > vidos-config.json",
"build-config": "npx vite-node bin/build-config.ts > vidos-config.json",
"build-fixture": "ruby poi_explode.rb cypress/fixtures/teritorio/references/pois.geojson",
"dev": "TYPESCRIPT_CHECK=true yarn nuxi dev",
"build": "TYPESCRIPT_CHECK=true yarn prepare && yarn nuxi build",
Expand All @@ -17,7 +18,7 @@
"start:histoire": "CONFIG=vidos-config-empty.json yarn histoire dev",
"start:cypress": "CONFIG=vidos-config-empty.json yarn build-fixture && yarn run cypress open",
"lint": "yarn lint:js && yarn lint:style",
"lint:js": "yarn eslint --ext .js,.ts,.vue --ignore-path .gitignore .",
"lint:js": "eslint .",
"lint:style": "yarn stylelint **/*.{vue,css} --ignore-path .gitignore",
"test": "yarn test:cypress && yarn test:histoire",
"test:cypress": "yarn build-fixture && yarn run cypress run",
Expand Down Expand Up @@ -59,10 +60,9 @@
"vuetify": "^3.3.4"
},
"devDependencies": {
"@antfu/eslint-config": "^2.6.2",
"@babel/core": "^7.22.5",
"@babel/preset-env": "^7.22.5",
"@commitlint/cli": "^17.6.5",
"@commitlint/config-conventional": "^17.6.5",
"@fortawesome/fontawesome-svg-core": "^6.4.0",
"@fortawesome/free-brands-svg-icons": "^6.4.0",
"@fortawesome/free-regular-svg-icons": "^6.4.0",
Expand All @@ -73,8 +73,6 @@
"@mdi/font": "^7.2.96",
"@nuxt/image-edge": "1.0.0-rc.1-28119537.bfe30ab",
"@nuxt/types": "^2.17.0",
"@nuxtjs/eslint-config": "^12.0.0",
"@nuxtjs/eslint-module": "^4.1.0",
"@nuxtjs/i18n": "^8.0.0-beta.12",
"@nuxtjs/stylelint-module": "^5.1.0",
"@tailwindcss/forms": "^0.5.3",
Expand All @@ -86,24 +84,18 @@
"@types/lodash.uniqby": "^4.7.7",
"@types/lodash.without": "^4.4.7",
"@types/wcag-contrast": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"autoprefixer": "^10.4.14",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"cypress": "^12.14.0",
"cypress-html-validate": "^6.0.0",
"cypress-terminal-report": "^5.2.0",
"eslint": "^8.43.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-nuxt": "^4.0.0",
"geojson": "^0.5.0",
"histoire": "^0.16.2",
"html-validate": "^8.0.5",
"http-server": "^14.1.1",
"husky": "^8.0.3",
"json-loader": "^0.5.7",
"lint-staged": "^13.2.2",
"loader-utils": "^3.2.1",
"lodash.get": "^4.4.2",
"msw": "^1.2.2",
Expand Down
27 changes: 2 additions & 25 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
{
"vueCompilerOptions": {
"target": 3
},
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"sourceMap": true,
"strict": true,
"experimentalDecorators": true,
"baseUrl": ".",
"types": [
"node",
"@types/node",
"@nuxt/image-edge",
"@nuxtjs/sentry",
"@types/webpack",
"@pinia/nuxt",
"tailwindcss"
]
},
"exclude": [
"./node_modules",
"./dist",
"./.output",
"./bin"
]
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
}
Loading

0 comments on commit 73e5b84

Please sign in to comment.