eslint-plugin-shopify-lean
v2.2.0
Published
Forked Shopify’s ESLint rules without configs.
Downloads
6,385
Maintainers
Readme
ESLint Plugin Shopify Lean
Fork of Shopify’s ESLint rules (only):
- Excludes all code related to pre-made configurations and their dependencies.
- Fixes a few Windows related issues due to different path separator.
Installation
With Yarn
yarn add --dev eslint-plugin-shopify-lean
With npm
$ npm install eslint-plugin-shopify-lean --save-dev
Plugin-Provided Rules
This plugin provides the following custom rules, which are included as appropriate in all core linting configs:
- binary-assignment-parens: Require (or disallow) assignments of binary, boolean-producing expressions to be wrapped in parentheses.
- class-property-semi: Require (or disallow) semicolons for class properties.
- images-no-direct-imports: Prevent images from being directly imported.
- jest/no-snapshots: Disallows jest snapshots.
- jsx-no-complex-expressions: Disallow complex expressions embedded in in JSX.
- jsx-no-hardcoded-content: Disallow hardcoded content in JSX.
- jsx-prefer-fragment-wrappers: Disallow useless wrapping elements in favour of fragment shorthand in JSX.
- no-namespace-imports: Prevent namespace import declarations.
- no-useless-computed-properties: Prevent the usage of unnecessary computed properties.
- prefer-class-properties: Prefer class properties to assignment of literals in constructors.
- prefer-early-return: Prefer early returns over full-body conditional wrapping in function declarations.
- no-ancestor-directory-import: Prefer imports from within a directory extend to the file from where they are importing without relying on an index file.
- prefer-module-scope-constants: Prefer that screaming snake case variables always be defined using
const
, and always appear at module scope. - prefer-twine: Prefer Twine over Bindings as the name for twine imports.
- react-hooks-strict-return: Restrict the number of returned items from React hooks.
- react-initialize-state: Require that React component state be initialized when it has a non-empty type.
- react-no-multiple-render-methods: Disallow multiple render methods in React component classes.
- react-prefer-private-members: Prefer all non-React-specific members be marked private in React class components.
- react-type-state: Require that React component state be typed in TypeScript.
- restrict-full-import: Prevent importing the entirety of a package.
- sinon-no-restricted-features: Restrict the use of specified sinon features.
- sinon-prefer-meaningful-assertions: Require the use of meaningful sinon assertions through sinon.assert or sinon-chai.
- strict-component-boundaries: Prevent module imports between components.
- typescript/prefer-pascal-case-enums: Prefer TypeScript enums be defined using Pascal case.
- typescript/prefer-singular-enums: Prefer TypeScript enums be singular.
- typescript/prefer-build-client-schema: Prefer buildClientSchema for schema building.
- webpack/no-unnamed-dynamic-imports: Require that all dynamic imports contain a
webpackChunkName
comment.
Copyright
Copyright 2020-presentShopify Copyright 2020-presentSebastian Software GmbH