You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ra...@apache.org on 2019/11/09 10:43:15 UTC
[cordova-eslint] branch master updated: docs: use new 'overrides'
directive in sample config (#9)
This is an automated email from the ASF dual-hosted git repository.
raphinesse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-eslint.git
The following commit(s) were added to refs/heads/master by this push:
new 84d08a6 docs: use new 'overrides' directive in sample config (#9)
84d08a6 is described below
commit 84d08a6fb7053f0e31d40d9a75c31108410d99f1
Author: Raphael von der GrĂ¼n <ra...@gmail.com>
AuthorDate: Sat Nov 9 11:43:06 2019 +0100
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`
---
README.md | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index f11bd91..fecd37c 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@ npm i -D @cordova/eslint-config
# In package.json
{
"scripts": {
- "eslint": "eslint ."
+ "lint": "eslint ."
}
}
```
@@ -45,17 +45,16 @@ npm i -D @cordova/eslint-config
```yml
# In .eslintrc.yml
root: true
+
extends: '@cordova/eslint-config/node'
-```
-```yml
-# In spec/.eslintrc.yml
-extends: '@cordova/eslint-config/node-tests'
-```
+overrides:
-```yml
-# In cordova-js-src/.eslintrc.yml
-extends: '@cordova/eslint-config/browser'
+- files: [spec/**/*.js]
+ extends: '@cordova/eslint-config/node-tests'
+
+- files: [cordova-js-src/**/*.js]
+ extends: '@cordova/eslint-config/browser'
```
## Reference
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org