The ESLint config used within Tobii Cloud Services.
In your project's .eslintrc.js
module.exports = {
extends: [
'firecloud/node'
],
rules: {
'override-some-rule': error
}
}
Optionally, you can run node_modules/eslint-config-firecloud/npm-install-peer-dependencies
in order to install the required peer dependencies.
If you want to use an addon, it's as easy as doing this in .eslintrc.js
:
module.exports = {
extends: [
'firecloud/node',
'firecloud/configs/jest'
],
rules: {
'override-some-rule': error
}
}
and running npm install --dev eslint-plugin-jest
.
Common bundles are provided as following:
- Node.js:
firecloud/node
- Browser:
firecloud/browser
These addons require you to install the plugin manually:
@typescript-eslint/eslint-plugin
:firecloud/configs/typescript
eslint-plugin-jasmine
:firecloud/configs/jasmine
eslint-plugin-jest
:firecloud/configs/jest
eslint-plugin-mocha
(with Chai):firecloud/configs/mocha
eslint-plugin-protractor
:firecloud/configs/protractor
eslint-plugin-vue
:firecloud/configs/vue
"I (don't) like/want ..." is no argument in this codebase. Instead, we follow a few guiding principles that have concrete consequences on daily work.
- lines
- functions
- modules
- do less on the same line
- break array/object expressions/patterns
- break import specifiers
- break conditions
- even if code becomes more verbose
- use a transpiler like babel (for syntax)
- use a utility library like lodash-firecloud (for functionality)
- don't use arrow functions when you don't need them
- don't use template literals when you don't need them
- https://www.robinwieruch.de/javascript-naming-conventions
- Not strictly related to eslint/style, but when writing TypeScript, see our guideline.