stylelint-config-recommended-vue icon indicating copy to clipboard operation
stylelint-config-recommended-vue copied to clipboard

error with [email protected]

Open qingtiantongxie opened this issue 2 years ago • 1 comments

my package.json

    "postcss-html": "^1.5.0",
    "postcss-less": "^6.0.0",
    "postcss-lit": "^0.5.0",
    "prettier": "^2.7.1",
    "stylelint": "14.0.0",
    "stylelint-config-prettier": "^9.0.3",
    "stylelint-config-rational-order": "^0.1.2",
    "stylelint-config-recommended-vue": "^1.4.0",
    "stylelint-config-standard": "^28.0.0",
    "stylelint-config-standard-vue": "^1.0.0",
    "stylelint-order": "^5.0.0",

and .stylelintrc.js

module.exports = {
  extends: [
     'stylelint-config-recommended-vue',
  ],
  defaultSeverity: 'warning',
  rules: {
    'at-rule-no-unknown': [
      true,
      {
        ignoreAtRules: ['plugin'],
      },
    ],
    'rule-empty-line-before': [
      'always',
      {
        except: ['after-single-line-comment', 'first-nested'],
      },
    ],
    'selector-pseudo-class-no-unknown': [
      true,
      {
        ignorePseudoClasses: ['deep'],
      },
    ],
  },
  overrides: [
    {
      files: ['*.less', '**/*.less'],
      customSyntax: 'postcss-less',
    },
    // {
    //   files: ['*.vue', '**/*.vue'],
    //   customSyntax: 'postcss-html',
    // },
  ],
}

<template>
  <a-button @click="changeMsg">click to change msg</a-button>
  <p>{{ msg }}</p>
  <a-button @click="handlePush">增加</a-button>
  <a-button @click="handleDele">删除</a-button>

  <ul>
    <li v-for="item in array" :key="item">{{ item }}</li>
  </ul>

  <h2> 循环obj </h2>
  <ul>
    <li v-for="(value, key) in obj" :key="key">{{ key }}:{{ value }}</li>
  </ul>
</template>

<script lang="ts" setup name="demo">
  const msg = ref('this is a message ')
  const changeMsg = () => {
    msg.value = 'now i have changed to another preh'
  }

  const array = reactive<Array<string | number>>([0])

  const handlePush = () => {
    array.push('new one')
  }

  const handleDele = () => {
    const l = array.length
    array.splice(l - 1)
  }

  interface Obj {
    [x: string]: any
  }
  const obj = reactive<Obj>({})
  setTimeout(() => {
    obj.name = '张三'
  }, 2000)
</script>

then use npx stylelint "src/views/demo/demo.vue"

got an error with below:

TypeError: Cannot read properties of undefined (reading 'stringify') at Function.stringify (/Users/ziluohuanghun/Desktop/bachangPro/node_modules/.pnpm/[email protected][email protected]/node_modules/postcss-syntax/stringify.js:8:38) at MapGenerator.generate (/Users/ziluohuanghun/Desktop/bachangPro/node_modules/.pnpm/[email protected]/node_modules/postcss/lib/map-generator.js:328:12) at LazyResult.stringify (/Users/ziluohuanghun/Desktop/bachangPro/node_modules/.pnpm/[email protected]/node_modules/postcss/lib/lazy-result.js:277:20) at LazyResult.runAsync (/Users/ziluohuanghun/Desktop/bachangPro/node_modules/.pnpm/[email protected]/node_modules/postcss/lib/lazy-result.js:443:17) at LazyResult.async (/Users/ziluohuanghun/Desktop/bachangPro/node_modules/.pnpm/[email protected]/node_modules/postcss/lib/lazy-result.js:221:30) at LazyResult.then (/Users/ziluohuanghun/Desktop/bachangPro/node_modules/.pnpm/[email protected]/node_modules/postcss/lib/lazy-result.js:206:17)

how should i do to use stylelit with stylelint-config-recommended-vue ?

qingtiantongxie avatar Oct 19 '22 02:10 qingtiantongxie

Please share the GitHub repository where we can reproduce your issue.

ota-meshi avatar Oct 19 '22 02:10 ota-meshi

same

HanSuhhi avatar Oct 30 '22 08:10 HanSuhhi

Please share the GitHub repository where we can reproduce your issue.

ota-meshi avatar Oct 30 '22 09:10 ota-meshi