Skip to content

Commit

Permalink
Add nuxt config
Browse files Browse the repository at this point in the history
  • Loading branch information
samuveth committed Aug 21, 2023
1 parent 9a7122f commit 5bc4bea
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/eslint-nuxt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## `@snapshot-labs/eslint-config-nuxt`

### Installation

```
yarn add @snapshot-labs/eslint-config-nuxt
```

### Usage

```
{
"extends": "@snapshot-labs/nuxt"
}
```
84 changes: 84 additions & 0 deletions packages/eslint-nuxt/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
module.exports = {
extends: ['@nuxt/eslint-config', '@snapshot-labs/eslint-config-base'],
rules: {},
overrides: [
{
files: ['*.vue'],
rules: {
'vue/block-lang': [
'error',
{
script: {
lang: 'ts'
}
}
],
'vue/block-order': [
'error',
{
order: ['script', 'template', 'style']
}
],
'vue/component-api-style': ['error', ['script-setup', 'composition']],
'vue/component-name-in-template-casing': [
'error',
'PascalCase',
{
registeredComponentsOnly: false
}
],
'vue/define-emits-declaration': ['error', 'type-based'],
'vue/define-macros-order': [
'error',
{
order: [
'defineOptions',
'defineProps',
'defineEmits',
'defineSlots'
]
}
],
'vue/define-props-declaration': ['error', 'type-based'],
'vue/html-button-has-type': [
'error',
{
button: true,
submit: true,
reset: true
}
],
'vue/no-required-prop-with-default': [
'error',
{
autofix: false
}
],
'vue/no-root-v-if': 'error',
'vue/no-template-target-blank': [
'error',
{
allowReferrer: true,
enforceDynamicLinks: 'always'
}
],
'vue/no-unused-refs': 'error',
'vue/no-v-text': 'error',
'vue/padding-line-between-blocks': ['error', 'always'],
'vue/prefer-define-options': 'error',
'vue/prefer-true-attribute-shorthand': ['error', 'always'],
'vue/require-macro-variable-name': [
'error',
{
defineProps: 'props',
defineEmits: 'emit',
defineSlots: 'slots',
useSlots: 'slots',
useAttrs: 'attrs'
}
],
'vue/v-for-delimiter-style': ['error', 'in']
}
}
]
};
16 changes: 16 additions & 0 deletions packages/eslint-nuxt/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@snapshot-labs/eslint-config-nuxt",
"version": "0.1.0-beta.9",
"publishConfig": {
"access": "public"
},
"license": "MIT",
"main": "index.js",
"scripts": {
"lint": "eslint ."
},
"dependencies": {
"@snapshot-labs/eslint-config-base": "^0.1.0-beta.9",
"eslint-plugin-vue": "^9.7.0"
}
}

0 comments on commit 5bc4bea

Please sign in to comment.