@the-/lint

15.5.3 • Public • Published

@the-/lint

npm Version

Lint of the-frameworks

Installation

$ npm install @the-/lint --save

Usage

'use strict'

const { TheLint, rules } = require('@the-/lint')

async function tryExample() {
  const lint = new TheLint()

  // Use Buildin rules
  lint.add(
    'src/controllers/*Ctrl.js',
    rules.defaultExportRule({
      type: 'function',
    }),
  )

  // Use Custom rules
  lint.add('src/controllers/*Ctrl.js', ({ content, report }) => {
    const { EOL } = require('os')

    if (!content.endsWith(EOL)) {
      report('Should have end with EOL', {
        actual: JSON.stringify(content[content.length - 1]),
        expect: JSON.stringify(EOL),
      })
    }
  })

  await lint.run()
}

tryExample().catch((err) => console.error(err))

API Guide

See API Guide for more detail

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i @the-/lint

Weekly Downloads

36

Version

15.5.3

License

MIT

Unpacked Size

439 kB

Total Files

53

Last publish

Collaborators

  • okunishinishi