13.0.5 • Published 10 months ago

@xwtec/eslint-config-vue v13.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
10 months ago

@xwtec/eslint-config-vue

ESLint Configuration for xwtec vue projects

Install

# with yarn
yarn add --dev eslint @xwtec/eslint-config-vue

# with npm
npm install --save-dev eslint @xwtec/eslint-config-vue

Configuration

Add the following code to your eslint.config.mjs.

import xwtecEslintConfigVue from '@xwtec/eslint-config-vue';

export default [
  xwtecEslintConfigVue,
  {
    rules: {
      'unicorn/no-array-for-each': 'error',
    },
  },
].flat();

Rules

Error

#TypeRuleDescription
1errorvue/no-arrow-functions-in-watchdisallow using arrow functions to define watcher
2errorvue/no-async-in-computed-propertiesdisallow asynchronous actions in computed properties
3errorvue/no-child-contentdisallow element's child contents which would be overwritten by a directive like v-html or v-text
4errorvue/no-computed-properties-in-datadisallow accessing computed properties in data.
5errorvue/no-deprecated-dollar-listeners-apidisallow using deprecated $listeners (in Vue.js 3.0.0+)
6errorvue/no-deprecated-events-apidisallow using deprecated events api (in Vue.js 3.0.0+)
7errorvue/no-deprecated-filterdisallow using deprecated filters syntax (in Vue.js 3.0.0+)
8errorvue/no-deprecated-functional-templatedisallow using deprecated the functional template (in Vue.js 3.0.0+)
9errorvue/no-deprecated-html-element-isdisallow using deprecated the is attribute on HTML elements (in Vue.js 3.0.0+)
10errorvue/no-deprecated-inline-templatedisallow using deprecated inline-template attribute (in Vue.js 3.0.0+)
11errorvue/no-deprecated-props-default-thisdisallow deprecated this access in props default function (in Vue.js 3.0.0+)
12errorvue/no-deprecated-router-link-tag-propdisallow using deprecated tag property on RouterLink (in Vue.js 3.0.0+)
13errorvue/no-deprecated-v-isdisallow deprecated v-is directive (in Vue.js 3.1.0+)
14errorvue/no-deprecated-v-on-native-modifierdisallow using deprecated .native modifiers (in Vue.js 3.0.0+)
15errorvue/no-deprecated-vue-config-keycodesdisallow using deprecated Vue.config.keyCodes (in Vue.js 3.0.0+)
16errorvue/no-dupe-keysdisallow duplication of field names
17errorvue/no-dupe-v-else-ifdisallow duplicate conditions in v-if / v-else-if chains
18errorvue/no-duplicate-attributesdisallow duplication of attributes
19errorvue/no-export-in-script-setupdisallow export in <script setup>
20errorvue/no-expose-after-awaitdisallow asynchronously registered expose
21errorvue/no-lifecycle-after-awaitdisallow asynchronously registered lifecycle hooks
22errorvue/no-parsing-errordisallow parsing errors in <template>
23errorvue/no-reserved-keysdisallow overwriting reserved keys
24errorvue/no-reserved-propsdisallow reserved names in props
25errorvue/no-side-effects-in-computed-propertiesdisallow side effects in computed properties
26errorvue/no-template-keydisallow key attribute on <template>
27errorvue/no-textarea-mustachedisallow mustaches in <textarea>
28errorvue/no-use-computed-property-like-methoddisallow use computed property like method
29errorvue/no-useless-template-attributesdisallow useless attribute on <template>
30errorvue/no-v-for-template-key-on-childdisallow key of <template v-for> placed on child elements
31errorvue/no-v-text-v-html-on-componentdisallow v-text / v-html on component
32errorvue/no-watch-after-awaitdisallow asynchronously registered watch
33errorvue/require-slots-as-functionsenforce properties of $slots to be used as a function
34errorvue/require-toggle-inside-transitionrequire control the display of the content inside <transition>
35errorvue/return-in-emits-validatorenforce that a return statement is present in emits validator
36errorvue/valid-attribute-namerequire valid attribute names
37errorvue/valid-define-emitsenforce valid defineEmits compiler macro
38errorvue/valid-define-propsenforce valid defineProps compiler macro
39errorvue/valid-v-bindenforce valid v-bind directives
40errorvue/valid-v-cloakenforce valid v-cloak directives
41errorvue/valid-v-elseenforce valid v-else directives
42errorvue/valid-v-else-ifenforce valid v-else-if directives
43errorvue/valid-v-forenforce valid v-for directives
44errorvue/valid-v-htmlenforce valid v-html directives
45errorvue/valid-v-ifenforce valid v-if directives
46errorvue/valid-v-isenforce valid v-is directives
47errorvue/valid-v-memoenforce valid v-memo directives
48errorvue/valid-v-modelenforce valid v-model directives
49errorvue/valid-v-onenforce valid v-on directives
50errorvue/valid-v-onceenforce valid v-once directives
51errorvue/valid-v-preenforce valid v-pre directives
52errorvue/valid-v-showenforce valid v-show directives
53errorvue/valid-v-slotenforce valid v-slot directives
54errorvue/valid-v-textenforce valid v-text directives

Warn

#TypeRuleDescription
1warnvue/no-mutating-propsdisallow mutation of component props
2warnvue/no-reserved-component-namesdisallow the use of reserved names in component definitions
3warnvue/no-unused-varsdisallow unused variable definitions of v-for directives or scope attributes
4warnvue/prop-name-casingenforce specific casing for the Prop name in Vue components
5warnvue/require-default-proprequire default value for props
6warnvue/require-render-returnenforce render function to always return value
7warnvue/require-valid-default-propenforce props default values to be valid
8warnvue/return-in-computed-propertyenforce that a return statement is present in computed property
9warnvue/valid-template-rootenforce valid template root
10warnvue/valid-v-bind-syncenforce valid .sync modifier on v-bind directives

Fixable

#TypeRuleDescription
1warnvue/attribute-hyphenationenforce attribute naming style on custom components in template
2warnvue/attributes-orderenforce order of attributes
3warnvue/block-orderenforce order of component top-level elements
4warnvue/component-name-in-template-casingenforce specific casing for the component naming style in template
5warnvue/define-macros-orderenforce order of defineEmits and defineProps compiler macros
6warnvue/dot-notationEnforce dot notation whenever possible in <template>
7errorvue/eqeqeqRequire the use of === and !== in <template>
8warnvue/html-comment-content-spacingenforce unified spacing in HTML comments
9warnvue/html-self-closingenforce self-closing style
10warnvue/next-tick-styleenforce Promise or callback style in nextTick
11warnvue/no-deprecated-data-object-declarationdisallow using deprecated object declaration on data (in Vue.js 3.0.0+)
12warnvue/no-deprecated-dollar-scopedslots-apidisallow using deprecated $scopedSlots (in Vue.js 3.0.0+)
13warnvue/no-deprecated-scope-attributedisallow deprecated scope attribute (in Vue.js 2.5.0+)
14warnvue/no-deprecated-slot-scope-attributedisallow deprecated slot-scope attribute (in Vue.js 2.6.0+)
15warnvue/no-deprecated-v-on-number-modifiersdisallow using deprecated number (keycode) modifiers (in Vue.js 3.0.0+)
16warnvue/no-ref-as-operanddisallow use of value wrapped by ref() (Composition API) as an operand
17warnvue/no-required-prop-with-defaultenforce props with default values to be optional
18warnvue/no-shared-component-dataenforce component's data property to be a function
19warnvue/no-unsupported-featuresdisallow unsupported Vue.js syntax on the specified version
20warnvue/no-useless-mustachesdisallow unnecessary mustache interpolations
21warnvue/no-useless-v-binddisallow unnecessary v-bind directives
22warnvue/object-shorthandRequire or disallow method and property shorthand syntax for object literals in <template>
23warnvue/order-in-componentsenforce order of properties in components
24warnvue/padding-line-between-blocksrequire or disallow padding lines between blocks
25warnvue/prefer-define-optionsenforce use of defineOptions instead of default export.
26warnvue/prefer-import-from-vueenforce import from 'vue' instead of import from '@vue/*'
27warnvue/prefer-separate-static-classrequire static class names in template to be in a separate class attribute
28warnvue/prefer-templateRequire template literals instead of string concatenation in <template>
29warnvue/require-prop-type-constructorrequire prop type to be a constructor
30errorvue/this-in-templatedisallow usage of this in template
31warnvue/v-bind-styleenforce v-bind directive style
32warnvue/v-for-delimiter-styleenforce v-for directive's delimiter style
33warnvue/v-if-else-keyrequire key attribute for conditionally rendered repeated components
34warnvue/v-on-event-hyphenationenforce v-on event naming style on custom components in template
35warnvue/v-on-styleenforce v-on directive style
36warnvue/v-slot-styleenforce v-slot directive style
37warnvue/valid-next-tickenforce valid nextTick function calls

Relative

Links

License

MIT © xwtec

13.0.5

10 months ago

13.0.4

11 months ago

12.0.0

1 year ago

12.0.1

1 year ago

13.0.2

1 year ago

13.0.3

1 year ago

13.0.0

1 year ago

13.0.1

1 year ago

10.4.0

2 years ago

11.0.2

2 years ago

11.0.0

2 years ago

11.0.1

2 years ago

10.0.0

3 years ago

10.0.1

3 years ago

10.2.0

3 years ago

9.3.0

3 years ago

10.1.0

3 years ago

10.3.0

3 years ago

9.2.3

4 years ago

9.2.2

4 years ago

9.2.1

4 years ago

9.1.1

4 years ago

9.1.0

4 years ago

9.2.0

4 years ago

9.0.2

4 years ago

9.0.1

4 years ago

9.0.0

4 years ago

8.4.1

4 years ago

8.4.0

4 years ago

8.3.1

4 years ago

8.3.0

4 years ago

8.2.0

4 years ago

8.1.1

4 years ago

8.1.0

4 years ago

8.0.5

4 years ago

8.0.4

4 years ago

8.0.3

4 years ago

8.0.2

4 years ago

8.0.1

4 years ago

8.0.0

4 years ago

7.2.1

4 years ago

7.2.0

4 years ago

7.1.4

4 years ago

7.1.3

4 years ago

7.1.2

4 years ago

7.1.1

5 years ago

7.1.0

5 years ago

7.0.2

5 years ago

7.0.1

5 years ago

7.0.0

5 years ago

6.3.1

5 years ago

6.3.0

5 years ago

6.2.1

5 years ago

6.2.0

5 years ago

6.1.1

5 years ago

6.1.0

5 years ago

6.0.17

5 years ago

6.0.16

5 years ago

6.0.15

5 years ago

6.0.14

6 years ago

6.0.13

6 years ago

6.0.12

6 years ago

6.0.11

6 years ago

6.0.10

6 years ago

6.0.9

6 years ago

6.0.8

6 years ago

6.0.7

6 years ago

6.0.6

6 years ago

6.0.5

6 years ago

6.0.4

6 years ago

6.0.3

6 years ago

6.0.2

6 years ago

5.2.6

6 years ago

5.2.5

6 years ago

5.2.4

6 years ago

5.2.3

6 years ago

5.2.2

6 years ago

5.2.1

6 years ago

5.2.0

6 years ago

5.1.4

6 years ago

5.1.3

6 years ago

5.1.2

6 years ago

5.1.1

6 years ago

5.1.0

6 years ago

5.0.1

6 years ago

5.0.0

6 years ago

4.1.12

6 years ago

4.1.11

6 years ago

4.1.10

6 years ago

4.1.9

6 years ago

4.1.8

6 years ago

4.1.7

6 years ago