From 690cb78349cae4eb9fd2abfe3de9f407c0d0642c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikitovics=20M=C3=A1rk?= Date: Wed, 6 Apr 2016 16:44:16 +0200 Subject: [PATCH] upgrade-to-eslint2 * upgrade * argon es6 fix, edited readme.md * Version increment to 2.0.0 in package.json --- README.md | 7 +++---- package.json | 4 ++-- src/components/_babel.yaml | 7 +++++++ src/components/_es2015Argon.yaml | 5 +++++ src/components/_mochaTest.yaml | 4 ++++ src/components/common/_possibleErrors.yaml | 2 -- src/components/common/_stylisticIssues.yaml | 4 +--- 7 files changed, 22 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 506ade7..746f3c7 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,12 @@ Sharable eslint config created and used by CodingSans ## ESLINT Version -This config created for eslint 1.10.* -If you want to use eslint 2+ you must wait, or use a later version of this package. +This config created for eslint 2.7.* ## Installation ``` -npm install --save-dev eslint@1.10 eslint-config-codingsans +npm install --save-dev eslint@2.7 eslint-config-codingsans ``` ## Usage @@ -17,7 +16,7 @@ npm install --save-dev eslint@1.10 eslint-config-codingsans Choose a config: - `codingsans` - Default config, alias for argon. -- `codingsans/argon` - Config created for working with Node 4.2 (Argon). +- `codingsans/argon` - Config created for working with Node 4 (Argon). - `codingsans/babel` - Config created for babel ES6. - `codingsans/mochaTestExt` - Config created for mocha test folders (this is an extension config). - More to come... diff --git a/package.json b/package.json index b6f6e06..07870e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-codingsans", - "version": "1.2.0", + "version": "2.0.0", "description": "CodingSans Eslint config", "main": "index.js", "scripts": { @@ -21,6 +21,6 @@ "eslint-sharable-config-generator": "^1.0.1" }, "peerDependencies": { - "eslint": "^1.10.3" + "eslint": "^2.7.0" } } diff --git a/src/components/_babel.yaml b/src/components/_babel.yaml index 5a72a80..046e656 100644 --- a/src/components/_babel.yaml +++ b/src/components/_babel.yaml @@ -1,6 +1,13 @@ extends: - ./es2015/_babelFeatures.yaml - ./es2015/_commonRules.yaml +## http://eslint.org/docs/user-guide/configuring.html#specifying-environments +## adds all of the es6 global variables. +env: + es6: true + +## parses the code with babel +parser: "babel-eslint" rules: ############################## diff --git a/src/components/_es2015Argon.yaml b/src/components/_es2015Argon.yaml index f509a4f..88a53a6 100644 --- a/src/components/_es2015Argon.yaml +++ b/src/components/_es2015Argon.yaml @@ -2,6 +2,11 @@ extends: - ./es2015/_argonFeatures.yaml - ./es2015/_commonRules.yaml +## http://eslint.org/docs/user-guide/configuring.html#specifying-environments +## adds all of the es6 global variables. +env: + es6: true + rules: ############################## # Strict Mode diff --git a/src/components/_mochaTest.yaml b/src/components/_mochaTest.yaml index 90be394..df174cd 100644 --- a/src/components/_mochaTest.yaml +++ b/src/components/_mochaTest.yaml @@ -34,3 +34,7 @@ rules: ## https://github.com/eslint/eslint/blob/master/docs/rules/new-cap.md ## Turned off for testing reasons new-cap: 0 + ## Forbids lone blocks + ## https://github.com/eslint/eslint/blob/master/docs/rules/no-lone-blocks.md + ## Turned off for testing reasons + no-lone-blocks: 0 diff --git a/src/components/common/_possibleErrors.yaml b/src/components/common/_possibleErrors.yaml index 0f0bbb2..f74c4fe 100644 --- a/src/components/common/_possibleErrors.yaml +++ b/src/components/common/_possibleErrors.yaml @@ -45,7 +45,5 @@ rules: no-unreachable: 2 ## isnan should be used for nan compare use-isnan: 2 - ## check for valid jsdoc - valid-jsdoc: 2 ## require valid typeof compared string like typeof foo === 'string' valid-typeof: 2 diff --git a/src/components/common/_stylisticIssues.yaml b/src/components/common/_stylisticIssues.yaml index 38de407..9d3c2f2 100644 --- a/src/components/common/_stylisticIssues.yaml +++ b/src/components/common/_stylisticIssues.yaml @@ -70,7 +70,7 @@ rules: ## put semi-colon semi: [2, "always"] # require space after keywords, eg 'for (..)' - space-after-keywords: 2 + keyword-spacing: 2 ## require space before blocks, eg 'function() {' space-before-blocks: [2, "always"] ## no space before function, eg. 'function()' @@ -79,5 +79,3 @@ rules: space-in-parens: [2, "never"] ## require spaces operator like var sum = 1 + 1; space-infix-ops: 2 - ## require spaces return, throw, case - space-return-throw-case: 2