Skip to content

Cant override extends` in config #9

@jankaderabek

Description

@jankaderabek

Version

module: 0.1.6
nuxt: 2.14.11

Nuxt configuration

mode:

  • universal
  • spa

Nuxt configuration

  buildModules: [
    '@nuxt/typescript-build',
    '@nuxtjs/composition-api',
    '@nuxtjs/stylelint-module',
    '@nuxtjs/router',
    '@nuxtjs/html-validator'
  ],
  htmlValidator: {
    usePrettier: false,
    options: {
      extends: [
        'html-validate:document'
      ],
      rules: {
      }
    }
  },

Reproduction

⚠️ without a minimal reproduction we wont be able to look into your issue

Link:
[ ] https://codesandbox.io/s/interesting-kilby-vqodg?file=/pages/index.vue

What is expected?

It should print errors only from 'html-validate:document' https://html-validate.org/rules/presets.html

What is actually happening?

It prints error like:

ERROR  HTML validation errors found for /
inline
    2:2    error  <html> is missing required "lang" attribute  element-required-attributes
  140:820  error  <img> is missing required "alt" attribute    wcag/h37

✖ 2 problems (2 errors, 0 warnings)
 (repeated 1 times)

wcag/h37 is not in 'html-validate:document' preset.

I think it is because wrong configuration merge, because it creates this result:

{                                                                                                                                                                 13:48:27
  extends: [
    'html-validate:document',
    'html-validate:recommended',
    'html-validate:standard',
    'html-validate:document'
  ],
  rules: {
    'svg-focusable': 'off',
    'no-unknown-elements': 'error',
    'void-style': 'off',
    'no-trailing-whitespace': 'off',
    'require-sri': 'off',
    'attribute-boolean-style': 'off',
    'no-inline-style': 'off'
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions