3.0.4 • Published 3 years ago

@siteone/eslint-config v3.0.4

Weekly downloads
28
License
MIT
Repository
-
Last release
3 years ago

SiteOne ESLint config

This package includes the shareable ESLint configuration used by SiteOne. It's meant to be used on react projects.

It just takes recommended configuration from commonly used plugins and wrap's it up in one easy to use bundle. So we can maintain our eslint configuration in one place.

Installation

yarn add eslint @siteone/eslint-config --dev

OR

npm install eslint @siteone/eslint-config --save-dev

Configuration

Paste this in your .eslintrc.js

/* eslintrc.js */
module.exports = {
  extends: [
    "@siteone/eslint-config/common",
    "@siteone/eslint-config/flow", // Remove if you are not using flow
    "@siteone/eslint-config/cssmodules", // Remove if you are not using css modules
  ],
};

Recommended prettier configuration

/* .prettierrc */
{
  "tabWidth": 2,
  "useTabs": false,
  "semi": false,
  "singleQuote": true,
  "trailingComma": "all"
}

Import aliases

This config uses eslint-plugin-import so if you are using import aliases you need to configure them like so:

/* eslintrc.js */
const path = require("path");

module.exports = {
  extends: [
    "@siteone/eslint-config/common",
    "@siteone/eslint-config/flow",
    "@siteone/eslint-config/cssmodules",
  ],
  settings: {
    "import/resolver": {
      alias: [
        ["components", path.join(__dirname, "/src/components/")],
        // ...
      ],
    },
  },
};

So eslint-plugin-import can resolve imports like:

/* src/components/Button.js */
export default function Button() {
  return <button>Click me</button>;
}

/* src/pages/index.js */
import Button from "components/button"; // instead of ../components/Button

More in eslint-plugin-import docs.

NOTE: This wont make your imports work it just tells eslint where to look for them while linting.

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.0-alpha.0

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.2

6 years ago