diff --git a/.eslintrc b/.eslintrc index de22476..a2389a1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -9,14 +9,13 @@ "no-control-regex": 2, "no-div-regex": 1, "no-else-return": 2, - "no-empty-class": 2, + "no-empty-character-class": 2, "no-empty-label": 2, "no-eq-null": 2, "no-extend-native": 2, "no-extra-boolean-cast": 2, "no-unneeded-ternary": 2, - "no-extra-strict": 2, - "global-strict": [2, "always"], + "strict": [2, "global"], "no-inner-declarations": [2, "functions"], "no-iterator": 2, "no-labels": 2, @@ -39,24 +38,23 @@ "no-shadow": 2, "no-shadow-restricted-names": 2, "no-spaced-func": 2, - "no-space-before-semi": 2, + "semi-spacing": [2, {"before": false, "after": true}], "no-sparse-arrays": 2, "no-sync": 0, "no-undef": 2, "no-unused-expressions": 2, "no-unused-vars": [2, {"vars": "all", "args": "after-used"}], - "no-warning-comments": [0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }], - "no-wrap-func": 2, + "no-warning-comments": [0, {"terms": ["todo", "fixme", "xxx"], "location": "start"}], "yoda": 2, "block-scoped-var": 2, - "brace-style": [2, "1tbs", { "allowSingleLine": true }], + "brace-style": [2, "1tbs", {"allowSingleLine": true}], "consistent-return": 2, - "consistent-this": [0, "self"], + "consistent-this": [1, "self"], "curly": [2, "all"], "default-case": 0, "func-names": 0, - "func-style": [0, "declaration"], + "func-style": [2, "declaration"], "max-depth": [0, 4], "max-len": [0, 80, 4], "max-nested-callbacks": [0, 2], @@ -67,7 +65,6 @@ "space-in-brackets": [0, "never"], "space-infix-ops": 2, "space-return-throw-case": 2, - "strict": 2, "valid-typeof": 2, "wrap-regex": 0, @@ -81,9 +78,9 @@ "no-empty": 2, "no-eval": 2, "no-ex-assign": 2, - "no-extra-parens": 0, + "no-extra-parens": 2, "no-extra-semi": 2, - "no-floating-decimal": 1, + "no-floating-decimal": 2, "no-func-assign": 2, "no-invalid-regexp": 2, "no-implied-eval": 2, @@ -104,22 +101,24 @@ "no-label-var": 2, "no-ternary": 0, "no-self-compare": 2, - "no-use-before-define": 0, + "no-use-before-define": [2, "nofunc"], "valid-jsdoc": 0, "eol-last": 0, - "no-trailing-spaces": 0, - "no-extra-bind": 2, + "no-undefined": 0, + "no-mixed-spaces-and-tabs": [2, true], + "no-trailing-spaces": 0, + "no-extra-bind": 2, "camelcase": 0, "dot-notation": 2, "eqeqeq": 2, "new-parens": 2, "guard-for-in": 2, - "radix": 0, + "radix": 1, "new-cap": 2, "semi": 2, "use-isnan": 2, - "quotes": [1, "single", "avoid-escape"], + "quotes": [2, "single", "avoid-escape"], "max-params": [0, 3], "max-statements": [0, 10], "complexity": [0, 11], @@ -128,13 +127,18 @@ "quote-props": [2, "as-needed"], "no-multi-spaces": 2, - "key-spacing": [2, { "beforeColon": false, "afterColon": true }], + "key-spacing": [2, {"beforeColon": false, "afterColon": true}], "comma-spacing": 2, - "space-unary-ops": [2, { "words": true, "nonwords": false }], - "indent": [2, 4], + "space-unary-ops": [2, {"words": true, "nonwords": false}], + "indent": [2, 4, {"SwitchCase": 1}], "space-before-function-paren": [2, {"anonymous": "always", "named": "never"}], + "space-before-blocks": [2, "always"], + "operator-linebreak": [2, "after"], + "dot-location": [2, "property"], "semi-spacing": [2, {"before": false, "after": true}], "array-bracket-spacing": [2, "never"], + "object-curly-spacing": [2, "never"], + "no-throw-literal": 2, "react/display-name": 2, "react/jsx-boolean-value": 1, diff --git a/package.json b/package.json index 565c763..1a67cce 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "grunt-contrib-requirejs": "^0.4.4", "grunt-contrib-uglify": "^0.9.1", "grunt-contrib-watch": "^0.6.1", - "grunt-eslint": "^16.0.0", + "grunt-eslint": "^17.0.0", "grunt-node-tap": "^0.1.61", "istanbul": "^0.3.17", "react": "^0.12.2", diff --git a/playground/.eslintrc b/playground/.eslintrc index d08730c..4c83dc3 100644 --- a/playground/.eslintrc +++ b/playground/.eslintrc @@ -1,6 +1,6 @@ { "rules": { - "global-strict": 0 + "strict": [2, "function"] }, "env": { "browser": true, diff --git a/playground/aceEditor.js b/playground/aceEditor.js index b276ba0..9c7fd4b 100644 --- a/playground/aceEditor.js +++ b/playground/aceEditor.js @@ -1,10 +1,9 @@ /** * Created by avim on 11/25/2014. */ -'use strict'; /*global ace:true*/ define(['react', 'lodash']/*, 'ace'*/, function (React, _/*, ace*/) { - + 'use strict'; return React.createClass({ displayName: 'BraceEditor', propTypes: { diff --git a/playground/examples.js b/playground/examples.js index fb8b2a0..ea5a626 100644 --- a/playground/examples.js +++ b/playground/examples.js @@ -1,4 +1,3 @@ -'use strict'; define(['lodash', 'react', './examples.rt', 'text!./samples/hello.code', 'text!./samples/hello.rt', 'text!./samples/todo.code', 'text!./samples/todo.rt', @@ -8,6 +7,7 @@ define(['lodash', 'react', './examples.rt', 'text!./samples/weather.code', 'text!./samples/weather.rt', 'text!./samples/rt-require.rt' ], function (_, React, examplesTemplate, helloCode, helloRT, todoCode, todoRT, rtIfCode, rtIfRT, rtPropsCode, rtPropsRT, rtRepeatCode, rtRepeatRT, weatherCode, weatherRT, rtRequireRT) { + 'use strict'; var samples = { hello: [helloCode, helloRT], todo: [todoCode, todoRT], diff --git a/playground/rt-main.js b/playground/rt-main.js index 398b88b..67761ba 100644 --- a/playground/rt-main.js +++ b/playground/rt-main.js @@ -1,3 +1,4 @@ +/*eslint strict:0*/ 'use strict'; /*eslint-env browser*/ /*var _ = */require('lodash'); diff --git a/src/reactTemplates.js b/src/reactTemplates.js index 906e3ef..d28fef8 100644 --- a/src/reactTemplates.js +++ b/src/reactTemplates.js @@ -79,7 +79,7 @@ var reactSupportedAttributes = ['accept', 'acceptCharset', 'accessKey', 'action' 'required', 'role', 'rows', 'rowSpan', 'sandbox', 'scope', 'scrolling', 'seamless', 'selected', 'shape', 'size', 'sizes', 'span', 'spellCheck', 'src', 'srcDoc', 'srcSet', 'start', 'step', 'style', 'tabIndex', 'target', 'title', 'type', 'useMap', 'value', 'width', 'wmode']; var classNameProp = 'className'; -var attributesMapping = {'class': classNameProp, 'rt-class': classNameProp, 'for': 'htmlFor'}; +var attributesMapping = {'class': classNameProp, 'rt-class': classNameProp, 'for': 'htmlFor'}; //eslint-disable-line quote-props _.forEach(reactSupportedAttributes, function (attributeReactName) { if (attributeReactName !== attributeReactName.toLowerCase()) { attributesMapping[attributeReactName.toLowerCase()] = attributeReactName;