Skip to content

Commit

Permalink
chore: upgrade eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed May 17, 2023
1 parent 50f1ff3 commit 1045565
Show file tree
Hide file tree
Showing 5 changed files with 1,548 additions and 1,054 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Use [Vue 3's Fragment feature](https://v3.vuejs.org/guide/migration/fragments.ht

```vue
<template>
<fragment> ⬅ This root element will not exist in the DOM
<Fragment> ⬅ This root element will not exist in the DOM

Check warning on line 7 in README.md

View workflow job for this annotation

GitHub Actions / Test

Expected 1 line break after opening tag (`<Fragment>`), but no line breaks found
<li>Element 1</li>
<li>Element 2</li>
<li>Element 3</li>
</fragment>
</Fragment>
</template>
<script>
Expand Down Expand Up @@ -56,9 +56,9 @@ The Component API is designed to be used at the root of the template. It should
Import `Fragment` and use it as the root element of your component:
```vue
<template>
<fragment>
<Fragment>
Hello world!
</fragment>
</Fragment>
</template>
<script>
Expand Down Expand Up @@ -116,20 +116,20 @@ Vue.directive('frag', frag)

#### Returning multiple root nodes <a href="https://codepen.io/hirokiosame/pen/PoNVZbV"><img src="https://img.shields.io/badge/codepen.io-demo-blue" valign="bottom"></a>
Component API
```vue
```html
<template>
<fragment> <!-- This element will be unwrapped -->
<Fragment> <!-- This element will be unwrapped -->

<div v-for="i in 10">
{{ i }}
</div>
</fragment>
</Fragment>
</template>
```


Directive API
```vue
```html
<template>
<div v-frag> <!-- This element will be unwrapped -->

Expand All @@ -143,17 +143,17 @@ Directive API
#### Unwrapping the root node from a component
Use the Directive API to unwrap the root node of a component.

```vue
```html
<template>
<div>
<!-- Unwraps the root node of some-custom-component -->
<some-custom-component v-frag />
<SomeCustomComponent v-frag />
</div>
</template>
```

#### Supports v-if too
```vue
```html
<template>
<div v-frag>
<template v-if="isShown">
Expand Down
21 changes: 9 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
],
"main": "dist/frag.cjs.js",
"module": "dist/frag.esm.js",
"unpkg": "dist/frag.js",
"types": "frag.d.ts",
"unpkg": "dist/frag.js",
"scripts": {
"prepare": "simple-git-hooks",
"build": "rollup -c --environment NODE_ENV:production",
Expand All @@ -48,12 +48,12 @@
},
"devDependencies": {
"@babel/preset-env": "^7.15.6",
"@pvtnbr/eslint-config": "^0.2.1",
"@pvtnbr/eslint-config": "^0.34.0",
"@rollup/plugin-babel": "^5.3.0",
"@vue/server-test-utils": "^1.3.0",
"@vue/test-utils": "^1.3.3",
"clean-pkg-json": "^1.2.0",
"eslint": "^7.32.0",
"eslint": "^8.40.0",
"jsdom": "^21.1.2",
"lint-staged": "^13.0.3",
"outdent": "^0.8.0",
Expand All @@ -74,20 +74,17 @@
},
"eslintConfig": {
"extends": "@pvtnbr",
"env": {
"browser": true
},
"rules": {
"symbol-description": "off",
"unicorn/no-array-for-each": "off"
"unicorn/prefer-at": "off"
},
"overrides": [
{
"files": "README.md/*",
"rules": {
"vue/multiline-html-element-content-newline": "off",
"vue/require-v-for-key": "off",
"vue/no-undef-components": "off"
"files": [
"src/**/*"
],
"env": {
"browser": true
}
}
]
Expand Down
Loading

0 comments on commit 1045565

Please sign in to comment.