openreachtech / eslint-rules-default

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

📄 Decide specification of main exports #34

Closed StewEucen closed 4 months ago

StewEucen commented 4 months ago

Overview

Note

// index.js (main of package.json)

const initials = require('./rules/initials')
const standard = require('./rules/standard')

/**
 * @type {ESLintDefaultRules}
 */
module.exports = {
  initials,
  standard,
}

/**
 * @typedef {{
 *   [x: string]: Array<*> // FIXME: fulfill `*` actually
 * }} ESLintDefaultRules 
 */
// ❌
module.exports = {
  standard: {
    initials,
    stylistic,
  },
}

// ✅
module.exports = {
  initials,
  stylistic,
  standard,
}
module.exports = {
  initials,
  stylistic,
  standard,
}

Decision Spec

// index.js (main of package.json)
export core from './rules/core'
export plugins from './rules/plugins'

// ./rules/plugins.js
export stylistic from './stylistic'
export jest from './jest'
export jsdoc from './jsdoc'

// ./rules/plugins/stylistic.js
export js from './js'
export plus from './plus'

// types.js
/**
 * @typedef {{
 *   [x: string]: Array<*> // FIXME: fulfill `*` actually
 * }} ESLintDefaultRules 
 */

Should all rules be handled in this repository or not?

StewEucen commented 4 months ago

About non-stylistic Rules

StewEucen commented 4 months ago