@subframe7536/eslint-config
TypeScript icon, indicating that this package has built-in type declarations

0.9.2 • Public • Published

@subframe7536/eslint-config

self use eslint config, extends antfu's config

difference

  • prefer curly everywhere
  • prefer global Buffer, process
  • ignores can start with ./
  • loose some rules
  • ignore solid/reactivity in watch()
  • type: 'lib' by default

setup

in eslint.config.js

import { GLOB_MARKDOWN_CODE, defineEslintConfig } from '@subframe7536/eslint-config'

export default defineEslintConfig({
  solid: true,
  type: 'app',
  ignoreAll: './dev/**.*',
  ignoreRulesOnFiles: {
    files: [GLOB_MARKDOWN_CODE],
    rules: ['ts/explicit-function-return-type'],
  },
  overrideRules: {
    'node/prefer-global/buffer': ['error', 'always'],
  },
})

types:

import type { OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config'

type Options = Omit<OptionsConfig, 'overrides'> & {
  /**
   * Enable Solid-js rules
   */
  solid?: boolean
  /**
   * Ignore files
   */
  ignores?: string | string[]
  /**
   * Override all rules
   */
  overrideRules?: TypedFlatConfigItem['rules']
}

in .vscode/settings.json

{
  // Enable the ESlint flat config support
  "eslint.experimental.useFlatConfig": true,

  // Disable the default formatter, use eslint instead
  "prettier.enable": false,
  "editor.formatOnSave": false,

  // Auto fix
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.organizeImports": "never"
  },

  // Enable eslint for all supported languages
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "vue",
    "html",
    "markdown",
    "json",
    "jsonc",
    "yaml"
  ]
}

Readme

Keywords

Package Sidebar

Install

npm i @subframe7536/eslint-config

Weekly Downloads

26

Version

0.9.2

License

MIT

Unpacked Size

18.7 kB

Total Files

6

Last publish

Collaborators

  • subframe7536