openreachtech / eslint-rules-default

A showcasing package all the rules of ESLint.
MIT License
0 stars 0 forks source link

📄 Fix sample code in README #270

Closed StewEucen closed 3 months ago

StewEucen commented 3 months ago

Overview

Note


```js
// eslint.config.js
import ruleHash from '@openreachtech/eslint-rules-default'

export default [
  {
    rules: {
      ...ruleHash.core.rules,
      ...ruleHash.disableCoreStylistic.rules,

      indent: [ // <---------------------- ❌ it is `@stylistic/indent`, thus can not use it here
        'error',
        2, // 4 <--- ✅
      ],
      quotes: [ // <---------------------- ❌ it is `@stylistic/quotes`, thus can not use it here
        'error',
        'single', // 'double' <--- ✅
        {
          avoidEscape: true,
          allowTemplateLiterals: false,
        },
      ],
      semi: [ // <---------------------- ❌ it is `@stylistic/semi`, thus can not use it here
        'error',
        'never', // 'always' <--- ✅
        {
          beforeStatementContinuationChars: 'never', // 'any' <--- ✅
        },
      ],
      ...
    },
  },
]


## Tasks

- [x] #275
- [x] #277