diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 4d7e7109..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,97 +0,0 @@ -module.exports = { - root: true, - env: { - browser: true, - }, - extends: [ - 'plugin:vue/vue3-recommended', - '@vue/standard', - '@vue/typescript/recommended', - ], - parser: 'vue-eslint-parser', - parserOptions: { - ecmaVersion: 2020, - }, - globals: { - name: 'off', - defineExpose: false, - __HISTOIRE_DEV__: false, - }, - rules: { - 'vue/html-closing-bracket-newline': [ - 'error', - { - singleline: 'never', - multiline: 'always', - }, - ], - 'no-var': ['error'], - '@typescript-eslint/member-delimiter-style': [ - 'error', - { - multiline: { - delimiter: 'none', - }, - singleline: { - delimiter: 'comma', - }, - }, - ], - '@typescript-eslint/ban-ts-comment': 'warn', - '@typescript-eslint/no-use-before-define': 'off', - 'comma-dangle': ['error', 'always-multiline'], - 'vue/no-multiple-template-root': 'off', - indent: 'off', - '@typescript-eslint/indent': ['error', 2], - 'no-use-before-define': 'off', - quotes: ['error', 'single', { allowTemplateLiterals: true }], - 'vue/multi-word-component-names': 'warn', - '@typescript-eslint/type-annotation-spacing': ['error'], - 'func-call-spacing': 'off', - '@typescript-eslint/func-call-spacing': ['error'], - '@typescript-eslint/no-empty-interface': 'off', - }, - overrides: [ - { - files: ['*.vue'], - rules: { - 'import/first': 'off', - }, - globals: { - defineProps: false, - defineEmits: false, - }, - }, - { - files: ['**/cypress/**'], - extends: [ - 'plugin:cypress/recommended', - ], - rules: { - 'cypress/unsafe-to-chain-command': 'off', - }, - }, - { - files: ['packages/histoire-vendors/*.d.ts'], - rules: { - 'import/export': 'off', - }, - }, - { - files: ['packages/histoire-vendors/src/**/*.ts'], - rules: { - 'import/no-named-default': 'off', - }, - }, - ], - ignorePatterns: [ - 'node_modules/', - 'dist/', - 'histoire-dist/', - 'generated/', - '!.*', - '.nuxt/', - '.output/', - 'examples/sveltekit', - ], -} diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 4babd320..07968d7c 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -5,4 +5,4 @@ contact_links: about: Use GitHub discussions for message-board style questions and discussions. - name: Discord Chat url: https://discord.gg/KpCnT72rJk - about: Ask questions and discuss with other Histoire users in real time. \ No newline at end of file + about: Ask questions and discuss with other Histoire users in real time. diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 4efa9e79..e8d7ba56 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -1,4 +1,4 @@ -name: "Check PR title" +name: Check PR title on: pull_request_target: diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 13aa2f52..a965d944 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -3,7 +3,7 @@ name: Create release on: push: tags: - - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 workflow_dispatch: jobs: diff --git a/.github/workflows/test-nuxt3.yml b/.github/workflows/test-nuxt3.yml index 847bb01d..141000ac 100644 --- a/.github/workflows/test-nuxt3.yml +++ b/.github/workflows/test-nuxt3.yml @@ -62,7 +62,7 @@ jobs: - name: Run tests working-directory: ${{env.dir}} run: pnpm run ci - + - uses: actions/upload-artifact@v2 if: failure() with: diff --git a/.github/workflows/test-svelte4.yml b/.github/workflows/test-svelte4.yml index a726d67b..c06732e8 100644 --- a/.github/workflows/test-svelte4.yml +++ b/.github/workflows/test-svelte4.yml @@ -62,7 +62,7 @@ jobs: - name: Run tests working-directory: ${{env.dir}} run: pnpm run ci - + - uses: actions/upload-artifact@v2 if: failure() with: diff --git a/.github/workflows/test-vue3.yml b/.github/workflows/test-vue3.yml index 8a857e33..d947433a 100644 --- a/.github/workflows/test-vue3.yml +++ b/.github/workflows/test-vue3.yml @@ -67,7 +67,6 @@ jobs: # ./packages/*/dist # retention-days: 1 - test: runs-on: ubuntu-latest name: Test @@ -128,7 +127,7 @@ jobs: # the number of containers in the job matrix TOTAL_RUNNERS: 5 THIS_RUNNER: ${{ matrix.containers }} - + - uses: actions/upload-artifact@v2 if: failure() with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8de609f4..a2dc6490 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: uses: pnpm/action-setup@v2.2.4 with: version: 8.10.5 - + - name: Get pnpm store directory id: pnpm-cache run: | diff --git a/.stackblitz/codeflow.json b/.stackblitz/codeflow.json index 629d282f..7e7ff5a1 100644 --- a/.stackblitz/codeflow.json +++ b/.stackblitz/codeflow.json @@ -10,4 +10,4 @@ "@histoire/plugin-screenshot": "./packages/historie-plugin-screenshot" } } -} \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 6bde09ed..5dc87280 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,35 @@ "tailwindCSS.experimental.configFile": { "tailwind.config.cjs": "docs/**", "packages/histoire-app/tailwind.config.cjs": "packages/histoire-app/**", - "packages/histoire-controls/tailwind.config.cjs": "packages/histoire-controls/**", - } -} \ No newline at end of file + "packages/histoire-controls/tailwind.config.cjs": "packages/histoire-controls/**" + }, + + // Enable the ESlint flat config support + "eslint.experimental.useFlatConfig": true, + + // Disable the default formatter, use eslint instead + "editor.formatOnSave": false, + + // Auto fix + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.organizeImports": "never" + }, + + // Enable eslint for all supported languages + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "markdown", + "json", + "jsonc", + "yaml", + "toml", + "gql", + "graphql" + ] +} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 9094add0..b8b53426 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,4 +1,3 @@ - # Contributor Covenant Code of Conduct ## Our Pledge diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 00247b15..ef8cd473 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -150,7 +150,6 @@ pnpm run test:dev - Make sure tests pass! - - Commit messages must follow the [commit message convention](./.github/commit-convention.md) so that changelogs can be automatically generated. + {{ state }} diff --git a/docs/reference/vue3/variant.md b/docs/reference/vue3/variant.md index c057607a..fe28442e 100644 --- a/docs/reference/vue3/variant.md +++ b/docs/reference/vue3/variant.md @@ -48,10 +48,10 @@ Function that returns the intial state. ```vue @@ -83,7 +83,7 @@ It receives a payload object as parameter with the following properties: ```vue @@ -212,6 +212,7 @@ Props: diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..f1e998ae --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,25 @@ +import antfu from '@antfu/eslint-config' + +export default antfu({ + ignores: [ + '**/histoire-dist/', + '**/generated/', + '**/public/', + '**/.svelte-kit/', + ], +}, { + rules: { + 'curly': ['error', 'multi-line', 'consistent'], + 'antfu/if-newline': 'off', + 'antfu/no-import-dist': 'off', + 'node/prefer-global/process': 'off', + 'no-console': 'warn', + 'ts/no-use-before-define': 'warn', + 'vue/define-macros-order': 'off', // Bugged + }, +}, { + files: ['**/*.vue'], + rules: { + 'import/first': 'off', + }, +}) diff --git a/examples/nuxt3/components/AutoImport.story.vue b/examples/nuxt3/components/AutoImport.story.vue index 063980a3..f1874d95 100644 --- a/examples/nuxt3/components/AutoImport.story.vue +++ b/examples/nuxt3/components/AutoImport.story.vue @@ -1,5 +1,4 @@ + - - diff --git a/packages/histoire-controls/src/components/select/HstSelect.story.vue b/packages/histoire-controls/src/components/select/HstSelect.story.vue index f946a8af..dac2a3fe 100644 --- a/packages/histoire-controls/src/components/select/HstSelect.story.vue +++ b/packages/histoire-controls/src/components/select/HstSelect.story.vue @@ -16,7 +16,7 @@ const objectOptions = Object.keys(options).map(key => ({ const numberOptions = [0, 1, 2, 3, 4, 5] -function initState () { +function initState() { return { label: 'My really long label', select: 'crash-bandicoot', diff --git a/packages/histoire-controls/src/components/select/HstSelect.vue b/packages/histoire-controls/src/components/select/HstSelect.vue index 806d854a..32c806dc 100644 --- a/packages/histoire-controls/src/components/select/HstSelect.vue +++ b/packages/histoire-controls/src/components/select/HstSelect.vue @@ -6,8 +6,8 @@ export default {