3.0.0 • Published 4 years ago

@lamiaoy/eslint-config v3.0.0

Weekly downloads
18
License
-
Repository
bitbucket
Last release
4 years ago

@lamiaoy/eslint-config

Base ESLint config for Lamia projects

Install

With npm do:

npm install -D @lamiaoy/eslint-config

Create a .eslintrc.js to your project root with the following contents:

module.exports = {
    extends: '@lamiaoy/eslint-config'
};

Make sure you don't have any existing configs (.eslintrc.js, .eslintrc.yml, .eslintrc.json or similar). If you do, first merge their configurations into the new .eslintrc.js, and remove them afterwards.

Assuming ESLint is configured correctly, it should automatically pick up the new config.

Usage

You can configure PhpStorm to show lint errors in the IDE.

You should also add a convenience command to your package.json

...
"scripts": {
    "lint": "npm run lint:js && npm run lint:css"
    "lint:js": "eslint src/",
    "lint:css": "..." // Some CSS linter
}
...

Run the command with

$ npm run lint

You can also add a prepush hook through husky

"scripts": {
    "prepush": "npm run lint"
}

This will lint your code before pushing to BitBucket.

Override config

You can add / remove rules and environment configs freely in .eslintrc.js.

module.exports = {
    extends: '@lamiaoy/eslint-config',
    env: {
        browser: true // Allow browser globals, such as 'window' and 'document'
    },
    rules: {
        'no-console': 'off' // Allow console.log -statements in your code
    }
};

You can see the full list of available rules here.

3.0.0

4 years ago

3.0.0-dev.0

4 years ago

2.0.3

4 years ago

2.0.1

5 years ago

2.0.0

5 years ago

2.0.0-beta.3

5 years ago

2.0.0-beta.2

5 years ago

2.0.0-beta.1

5 years ago

2.0.0-beta.0

5 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago