Skip to content

Commit

Permalink
add a11y and antfu to linter and fix generated errors
Browse files Browse the repository at this point in the history
  • Loading branch information
VachetVirginie committed Jul 24, 2024
1 parent 2aea040 commit 7ba9fa6
Show file tree
Hide file tree
Showing 509 changed files with 29,419 additions and 26,298 deletions.
4 changes: 1 addition & 3 deletions packages/synapse-bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Pour utiliser ce package, vous pouvez installer un des starter kits suivants :
- [Starter Kit Bridge](https://github.com/assurance-maladie-digital/starter-kit-vue-bridge/tree/dev) (projets en migration)
- [Starter Kit Synapse](https://github.com/assurance-maladie-digital/starter-kit-vue-bridge/tree/dev) (nouveaux projets)


### Librairie uniquement

Vous pouvez également utiliser ce package en tant que librairie de composants dans votre projet.
Expand All @@ -44,7 +43,6 @@ Pour cela, vous pouvez l'installer via npm ou un autre gestionnaire de paquets :
npm i @cnamts/synapse-bridge
```


## Commandes disponibles

```bash
Expand All @@ -53,7 +51,7 @@ npm i @cnamts/synapse-bridge
"pnpm preview": Lancement du serveur de prévisualisation,
"pnpm test:unit": Lancement des tests unitaires,
"pnpm lint": Lancement de l\'analyseur de code,
```
```

## Contribution

Expand Down
2 changes: 1 addition & 1 deletion packages/synapse-bridge/dev/Playground.template.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div />
<div />
</template>
66 changes: 33 additions & 33 deletions packages/synapse-bridge/dev/main.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import { createApp } from 'vue'
import Playground from './Playground.vue'
import { router } from './router'
import { createStore } from 'vuex'
import { createApp } from "vue";
import { createStore } from "vuex";

import 'vuetify/styles'
import { createVuetify } from 'vuetify'
import { aliases, mdi } from 'vuetify/iconsets/mdi-svg'
import "vuetify/styles";
import { createVuetify } from "vuetify";
import { aliases, mdi } from "vuetify/iconsets/mdi-svg";

import { colorTheme } from '@cnamts/design-tokens/src/colors'
import { colorTheme } from "@cnamts/design-tokens/src/colors";
import Playground from "./Playground.vue";
import { router } from "./router";

import { notification } from '@/modules/notification'
import { notification } from "@/modules/notification";

const vuetify = createVuetify({
icons: {
defaultSet: 'mdi',
aliases,
sets: {
mdi,
},
},
theme: {
defaultTheme: 'light',
themes: {
light: {
colors: colorTheme,
},
dark: {
colors: colorTheme,
},
},
},
})
icons: {
defaultSet: "mdi",
aliases,
sets: {
mdi,
},
},
theme: {
defaultTheme: "light",
themes: {
light: {
colors: colorTheme,
},
dark: {
colors: colorTheme,
},
},
},
});

const store = createStore({
modules: {
notification,
},
})
modules: {
notification,
},
});

createApp(Playground).use(store).use(vuetify).use(router).mount('#app')
createApp(Playground).use(store).use(vuetify).use(router).mount("#app");
20 changes: 10 additions & 10 deletions packages/synapse-bridge/dev/router.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { createRouter, createWebHistory } from 'vue-router'
import { createRouter, createWebHistory } from "vue-router";

export const router = createRouter({
history: createWebHistory(),
routes: [
{
name: 'home',
path: '/',
component: () => import('./Playground.vue'),
},
],
})
history: createWebHistory(),
routes: [
{
name: "home",
path: "/",
component: () => import("./Playground.vue"),
},
],
});
54 changes: 47 additions & 7 deletions packages/synapse-bridge/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,49 @@
export default [
{
import a11y from "eslint-plugin-vuejs-accessibility";
import antfu from "@antfu/eslint-config";

export default antfu({
plugins: {
"vuejs-accessibility": a11y,
},
ignores: [
"src/elements/Logo/*",
"src/elements/CustomIcon/mixins/themeIcon.ts",
"src/assets/locales/*.json",
"src/assets/locales/*.json/**",
"public/**/*",
],
rules: {
...a11y.configs.recommended.rules,
"ts/semi": "off",
"curly": ["error", "all"],
"no-console": "error",
"no-alert": "off",
"no-shadow": "off",
"vue/html-self-closing": "off",
"vue/no-template-shadow": "off",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"style/max-len": ["error", { code: 120, tabWidth: 4 }],
"style/semi": ["error", "always"],
"style/indent": "off",
"style/quotes": ["error", "double"],
"style/no-tabs": "off",
"vuejs-accessibility/label-has-for": ["error", { required: { every: ["nesting"] } }],
"vuejs-accessibility/anchor-has-content": "off",
},
}, {
ignores: ["public/**/*"],
}, {
files: ["**/*.json", "**/*.md", "**/*.spec.ts"],
ignores: ["public/**/*.json"],
rules: {
"style/max-len": ["error", { code: 600, tabWidth: 2 }],
},

}, {
files: ["src/elements/FranceConnectBtn/FranceConnectBtn.vue", "src/elements/FilePreview/FilePreview.vue"],
rules: {
'vue/html-self-closing': 'off',
'vue/multi-word-component-names': 'off',
'@typescript-eslint/no-explicit-any': 'off',
"style/max-len": "off",
},
},
]

});
176 changes: 89 additions & 87 deletions packages/synapse-bridge/package.json
Original file line number Diff line number Diff line change
@@ -1,89 +1,91 @@
{
"name": "@cnamts/synapse-bridge",
"version": "1.4.8-alpha.0",
"description": "Portage of our components to Vue 3 without breaking changes",
"license": "MIT",
"author": {
"name": "CNAM",
"email": "digital_TL.cnam@assurance-maladie.fr"
},
"type": "module",
"files": [
"dist",
"src"
],
"main": "./dist/synapse-bridge.umd.cjs",
"module": "./dist/synapse-bridge.js",
"exports": {
".": {
"import": "./dist/synapse-bridge.js",
"require": "./dist/synapse-bridge.umd.cjs"
},
"./style.css": "./dist/style.css",
"./constants": "./src/constants/index.ts",
"./functions/*": "./src/functions/*/index.ts",
"./modules/*": "./src/modules/*/index.ts",
"./helpers/*": "./src/helpers/*/index.ts",
"./rules/*": "./src/rules/*/index.ts"
},
"types": "./dist/index.d.ts",
"scripts": {
"dev:setup": "tsx scripts/devSetup.ts",
"dev": "vite",
"test:unit": "vitest run",
"preview": "vite preview",
"analyze": "vite build --mode analyze",
"build": "vue-tsc && vite build",
"lint": "pnpm lint:eslint && pnpm lint:prettier",
"lint:eslint": "eslint . --ignore-pattern 'dist/*'",
"lint:prettier": "pnpm exec prettier . --write",
"lint:fix": "eslint . --fix && prettier --write --list-different .",
"generate:changelog": "auto-changelog -o CHANGELOG-TEMP.md -p --starting-date 2024-07-16"
},
"peerDependencies": {
"vue": "^3.4.21",
"vuetify": "3.5.10",
"vuex": "^4.1.0"
},
"dependencies": {
"@cnamts/design-tokens": "2.12.0",
"@vuepic/vue-datepicker": "^8.6.0",
"consola": "2.15.3"
},
"devDependencies": {
"@mdi/js": "7.2.96",
"@types/node": "18.11.9",
"@vitejs/plugin-vue": "4.3.4",
"@vitest/coverage-v8": "0.34.6",
"@vue/test-utils": "2.4.1",
"auto-changelog": "^2.4.0",
"axios": "^1.5.0",
"content-disposition-header": "^0.6.0",
"dayjs": "^1.8.0",
"deepmerge": "4.3.1",
"eslint": "^9.5.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"jest-serializer-vue": "3.1.0",
"jsdom": "22.1.0",
"languages": "^0.1.3",
"maska": "^2.1.11",
"prettier": "^3.3.2",
"resize-observer-polyfill": "1.5.1",
"rollup-plugin-visualizer": "5.9.2",
"sass": "1.67.0",
"sass-loader": "13.3.2",
"slugify": "^1.6.6",
"tsx": "3.13.0",
"typescript": "5.0.4",
"vite": "5.2.8",
"vite-plugin-dts": "3.6.0",
"vite-plugin-vuetify": "2.0.3",
"vitest": "0.34.6",
"vue-router": "4.2.5",
"vue-tsc": "1.8.11"
},
"publishConfig": {
"access": "public"
}
"name": "@cnamts/synapse-bridge",
"type": "module",
"version": "1.4.8-alpha.0",
"description": "Portage of our components to Vue 3 without breaking changes",
"author": {
"name": "CNAM",
"email": "digital_TL.cnam@assurance-maladie.fr"
},
"license": "MIT",
"exports": {
".": {
"import": "./dist/synapse-bridge.js",
"require": "./dist/synapse-bridge.umd.cjs"
},
"./style.css": "./dist/style.css",
"./constants": "./src/constants/index.ts",
"./functions/*": "./src/functions/*/index.ts",
"./modules/*": "./src/modules/*/index.ts",
"./helpers/*": "./src/helpers/*/index.ts",
"./rules/*": "./src/rules/*/index.ts"
},
"main": "./dist/synapse-bridge.umd.cjs",
"module": "./dist/synapse-bridge.js",
"types": "./dist/index.d.ts",
"files": [
"dist",
"src"
],
"scripts": {
"dev:setup": "tsx scripts/devSetup.ts",
"dev": "vite",
"test:unit": "vitest run",
"preview": "vite preview",
"analyze": "vite build --mode analyze",
"build": "vue-tsc && vite build",
"lint": "pnpm lint:eslint && pnpm lint:prettier",
"lint:eslint": "eslint . --ignore-pattern 'dist/*'",
"lint:prettier": "pnpm exec prettier . --write",
"lint:fix": "eslint . --fix && prettier --write --list-different .",
"generate:changelog": "auto-changelog -o CHANGELOG-TEMP.md -p --starting-date 2024-07-16"
},
"peerDependencies": {
"vue": "^3.4.21",
"vuetify": "3.5.10",
"vuex": "^4.1.0"
},
"dependencies": {
"@cnamts/design-tokens": "2.12.0",
"@vuepic/vue-datepicker": "^8.6.0",
"consola": "2.15.3"
},
"devDependencies": {
"@antfu/eslint-config": "^2.23.2",
"@mdi/js": "7.2.96",
"@types/node": "18.11.9",
"@vitejs/plugin-vue": "4.3.4",
"@vitest/coverage-v8": "0.34.6",
"@vue/test-utils": "2.4.1",
"auto-changelog": "^2.4.0",
"axios": "^1.5.0",
"content-disposition-header": "^0.6.0",
"dayjs": "^1.8.0",
"deepmerge": "4.3.1",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vuejs-accessibility": "^2.4.0",
"jest-serializer-vue": "3.1.0",
"jsdom": "22.1.0",
"languages": "^0.1.3",
"maska": "^2.1.11",
"prettier": "^3.3.2",
"resize-observer-polyfill": "1.5.1",
"rollup-plugin-visualizer": "5.9.2",
"sass": "1.67.0",
"sass-loader": "13.3.2",
"slugify": "^1.6.6",
"tsx": "3.13.0",
"typescript": "5.0.4",
"vite": "5.2.8",
"vite-plugin-dts": "3.6.0",
"vite-plugin-vuetify": "2.0.3",
"vitest": "0.34.6",
"vue-router": "4.2.5",
"vue-tsc": "1.8.11"
},
"publishConfig": {
"access": "public"
}
}
14 changes: 7 additions & 7 deletions packages/synapse-bridge/prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const config = {
trailingComma: 'es5',
tabWidth: 4,
semi: false,
singleQuote: true,
htmlWhitespaceSensitivity: 'ignore',
}
trailingComma: "es5",
tabWidth: 4,
semi: false,
singleQuote: true,
htmlWhitespaceSensitivity: "ignore",
};

export default config
export default config;
Loading

0 comments on commit 7ba9fa6

Please sign in to comment.