Skip to content

[DevEx]: Prevent unscoped <style> blocks with eslint rule enforce-style-attribute #1293

@itsalaidbacklife

Description

@itsalaidbacklife

Improvement Summary

We should configure the lint rule https://eslint.vuejs.org/rules/enforce-style-attribute to force all <style> blocks to be scoped except for the one in App.vue

Detailed Description

We generally require all style blocks to be scoped except for App.vue, where we put global styles. But we don't have a consistent way to enforce this. We should configure the above lint rule to require style blocks to be <style scoped> but add an override for App.vue that prevent the rule from applying to that file. Roughly this


  rules: {
    'vue-scoped-css/enforce-style-type': ['error', { allows: ['scoped', 'module'] }],
  },
  overrides: [
    {
      files: ['src/App.vue'],
      rules: {
        'vue-scoped-css/enforce-style-type': 'off',
      },
    },
  ],

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev experienceImprovements to the code base that make it easier/better/more enjoyable to contribute to CuttlefrontendRequires changes to the frontend (vue) clientgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions