commit | 84d08a6fb7053f0e31d40d9a75c31108410d99f1 | [log] [tgz] |
---|---|---|
author | Raphael von der GrĂ¼n <raphinesse@gmail.com> | Sat Nov 09 11:43:06 2019 +0100 |
committer | GitHub <noreply@github.com> | Sat Nov 09 11:43:06 2019 +0100 |
tree | 51b6b6c26a07b4dba2d163fe136f306595fd98e2 | |
parent | 0797149b04529ec4544208b09aef403c70445a96 [diff] |
docs: use new 'overrides' directive in sample config (#9) * docs: use new 'overrides' directive in sample config The new `overrides` directive allows us to configure different linting rule sets for all the files in a repo from the root `.eslintrc`. This commit updates the docs to use this kind of configuration setup. * docs: change npm script name in sample to `lint`
This repository centralizes the ESLint configuration used for Cordova's development.
@cordova/eslint-config
comes with all plugins configs and even eslint
itself. So all you need to do to get started is:
npm i -D @cordova/eslint-config
# In package.json { "scripts": { "lint": "eslint ." } }
# In .eslintrc.yml root: true extends: '@cordova/eslint-config/node' overrides: - files: [spec/**/*.js] extends: '@cordova/eslint-config/node-tests' - files: [cordova-js-src/**/*.js] extends: '@cordova/eslint-config/browser'
This package exposes the following shareable ESLint configurations:
@cordova/eslint-config/node
(or simply @cordova
)For linting scripts intended to be run with Node.js.
@cordova/eslint-config/node-tests
For linting Jasmine tests of Cordova's Node.js scripts.
@cordova/eslint-config/browser
For linting cordova-style CommonJS modules intended to be run in the browser (before they are bundled).
@cordova/eslint-config/browser-tests
For linting Jasmine tests of Cordova's browser code.