0.2.11 • Published 6 months ago

@dylanjs/eslint-config v0.2.11

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

eslint+prettier包

使用:

pnpm install eslint @dylanjs/eslint-config -D

项目根目录下创建eslint.config.js文件:

import { defineConfig } from '@dylanjs/eslint-config'
export default defineConfig({
  vue: true,
  react: { files: ['**/*react.tsx'] },
  solid: { files: ['**/*solid.tsx'] },
  svelte: true,
  astro: true,
  unocss: true,
  formatter: {
    html: true,
    css: true,
    json: true,
    markdown: true,
    yaml: true,
    toml: true
  },
  overrides: {
    'vue/multi-word-component-names': [
      'warn',
      {
        ignores: ['index', 'App', '[id]']
      }
    ]
  }
})

注意

如果在项目中执行lint命令使用报错Error: Cannot find package 'prettier-plugin-jsdoc' imported from C:\Users\my466\Desktop\demo\noop.js

需要在项目根目录中创建.npmrc文件,添加如下内容:

shamefully-hoist=true

这个命令的作用是将依赖项提升到项目的根目录中,这样就可以在项目中使用这些依赖项了。

然后就可以使用了。