@libs-for-dev/eslint-rules
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Strict ESLint rules for libs-for-dev repositories

This package provides the strictest ESLint rules for next type of files:

Installation

yarn add @libs-for-dev/eslint-rules

Usage

Add to your eslint.config.mjs config in project.

import { configs } from '@libs-for-dev/eslint-rules'
// Choose your project needs config
export default [
  configs.ignores,
  configs.json,
  configs.markdown,
  configs.packageJson,
  configs.typescript,
  configs.vitest,
  configs.vue,
]

Customisation

import { configs } from '@libs-for-dev/eslint-rules'

export default [
  configs.typescript,
  configs.vue,
  {
    files: configs.vue.files,
    languageOptions: configs.vue.languageOptions,
    plugins: configs.vue.plugins,
    rules: {
      'vue/block-lang': ['error', { script: { lang: 'js' } }],
    },
  },
  {
    plugins: {
      ...configs.javascript.plugins,
    },
    rules: {
      'check-file/filename-naming-convention': [
        'error', { '**/*.vue': 'CAMEL_CASE' },
      ],
    },
  },
  {
    files: ['**/*.test.ts'],
    rules: {
      'max-lines-per-function': ['error', { max: 80 }],
    },
  },
  {
    files: ['/some/specific/folder/*.ts'],
    rules: {
      'max-lines': 'off',
    },
  }
]

Readme

Keywords

none

Package Sidebar

Install

npm i @libs-for-dev/eslint-rules

Weekly Downloads

88

Version

2.0.0

License

MIT

Unpacked Size

41.5 kB

Total Files

54

Last publish

Collaborators

  • uwl