This package has been deprecated

Author message:

This package is deprecated. Please migrate to @shopify/loom-plugin-eslint

@sewing-kit/plugin-eslint
TypeScript icon, indicating that this package has built-in type declarations

0.4.4 • Public • Published

@sewing-kit/plugin-eslint

This package provides a sewing-kit plugin that runs ESLint as part of the sewing-kit lint command.

Installation

yarn add @sewing-kit/plugin-eslint --dev

eslint()

The eslint function returns a sewing-kit plugin. This plugin applies to the workspace, not an individual project.

import {createWorkspace} from '@sewing-kit/core';
import {eslint} from '@sewing-kit/plugin-eslint';

export default createWorkspace((workspace) => {
  workspace.use(eslint());
});

By default ESLint runs over everything in the current folder. You can modify the files that are processed by passing in a files glob to the plugin's options.

export default createWorkspace((workspace) => {
  // Run eslint on a single subfolder
  workspace.use(pretttier({files: 'some-subfolder/**/*'}));
});

Hooks

This plugin adds the following hooks to LintWorkspaceConfigurationCustomHooks:

  • eslintFlags: an object of options to convert into command line flags for the eslint command. These options are camelcase versions of their CLI counterparts.

    import {createWorkspaceLintPlugin} from '@sewing-kit/core';
    
    const plugin = createWorkspaceLintPlugin(({hooks}) => {
      hooks.configure.hook((configure) => {
        // Modify the maximum number of allowed warnings from the default of 0
        configure.eslintFlags?.hook((flags) => ({
          ...flags,
          maxWarnings: 5,
        }));
      });
    });

Readme

Keywords

none

Package Sidebar

Install

npm i @sewing-kit/plugin-eslint

Weekly Downloads

9

Version

0.4.4

License

MIT

Unpacked Size

9.25 kB

Total Files

10

Last publish

Collaborators

  • bpscott
  • lemonmade
  • shopify-dep