@bjervis/eslint-plugin-scoobie

1.0.2 • Public • Published

eslint-plugin-scoobie

Designed to work with projects using scoobie, this plugin detects when a component is being imported from the src submodule.

VSCode's autoimport has a strong tendency to pull from 'scoobie/src' rather than just 'scoobie', for some reason. This lint rule will error when it happens, and can also autofix.

There are some valid reasons to import from certain submodules in scoobie, and this should leave those alone.

Example

// error
import { SmartTextLink } from 'scoobie/src';

// fixes to
import { SmartTextLink } from 'scoobie';

// ok
import 'scoobie/types';

// also ok
import { robotoHtml, robotoMonoHtml } from 'scoobie/typography';

Usage

yarn add -D @bjervis/eslint-plugin-scoobie

Then in your eslint config

plugins: ['@bjervis/scoobie'],
rules: {
  '@bjervis/scoobie/no-src-import': 2,
},

If you're using Braid, you're probably also using sku, so:

// sku.config.js
module.exports = {
  ...,
  dangerouslySetESLintConfig: (skuConfig) => ({
    ...skuConfig,
    plugins: ['@bjervis/scoobie'],
    rules: {
      '@bjervis/scoobie/no-src-import': 2,
    },
  }),
}

Readme

Keywords

none

Package Sidebar

Install

npm i @bjervis/eslint-plugin-scoobie

Weekly Downloads

174

Version

1.0.2

License

MIT

Unpacked Size

5.41 kB

Total Files

7

Last publish

Collaborators

  • bjervis