Skip to content

Commit

Permalink
MDL-55835 eslint: bump to v3.7.1
Browse files Browse the repository at this point in the history
1) Bump eslint verson in npm
2) Enable tabs rule introduced in 3.2.0
3) With rules deprecated in 3.3.0 to their replacements
   http://eslint.org/blog/2016/08/eslint-v3.3.0-released
4) Deprecate the use of M.str (fixes MDLSITE-3646) with new
   no-restricted-properties introduced in 3.5.0
5) Fixup no-unused-vars - remove argsIgnorePattern which shouldn't have allowed
   partial matches and turns out to be uncesssary
   (detected because of eslint/eslint#7250 in 3.6.0)
  • Loading branch information
danpoltawski committed Oct 7, 2016
1 parent d9520bc commit 00c714f
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 54 deletions.
16 changes: 12 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
'no-inner-declarations': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-negated-in-lhs': 'error',
'no-obj-calls': 'error',
'no-prototype-builtins': 'off',
'no-regex-spaces': 'error',
'no-sparse-arrays': 'error',
'no-unexpected-multiline': 'error',
'no-unreachable': 'warn',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'use-isnan': 'error',
'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
'valid-typeof': 'error',
Expand All @@ -63,6 +63,7 @@
'no-extra-bind': 'warn',
'no-fallthrough': 'error',
'no-floating-decimal': 'warn',
'no-global-assign': 'warn',
// Enabled by grunt for AMD modules: 'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
Expand All @@ -71,7 +72,6 @@
'no-loop-func': 'error',
'no-multi-spaces': 'warn',
'no-multi-str': 'error',
'no-native-reassign': 'warn',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal': 'error',
Expand All @@ -96,7 +96,7 @@
'no-delete-var': 'error',
'no-undef': 'error',
'no-undef-init': 'error',
'no-unused-vars': ['error', { 'caughtErrors': 'none', 'argsIgnorePattern': "(e|event)" }],
'no-unused-vars': ['error', { 'caughtErrors': 'none' }],

// === Stylistic Issues ===
'array-bracket-spacing': 'warn',
Expand All @@ -108,6 +108,7 @@
'computed-property-spacing': 'error',
'consistent-this': 'off',
'eol-last': 'off',
'func-call-spacing': ['warn', 'never'],
'func-names': 'off',
'func-style': 'off',
// indent currently not doing well with our wrapping style, so disabled.
Expand Down Expand Up @@ -140,7 +141,7 @@
'no-nested-ternary': 'warn',
'no-new-object': 'off',
'no-plusplus': 'off',
'no-spaced-func': 'warn',
'no-tabs': 'error',
'no-ternary': 'off',
'no-trailing-spaces': 'error',
'no-underscore-dangle': 'off',
Expand Down Expand Up @@ -168,5 +169,12 @@
'spaced-comment': 'warn',
'unicode-bom': 'error',
'wrap-regex': 'off',

// === Deprecations ===
"no-restricted-properties": ['warn', {
'object': 'M',
'property': 'str',
'message': 'Use AMD module "core/str" or M.util.get_string()'
}],
}
}
2 changes: 2 additions & 0 deletions lib/amd/src/str.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since 2.9
*/
// Disable no-restriced-properties because M.str is expected here:
/* eslint-disable no-restricted-properties */
define(['jquery', 'core/ajax', 'core/localstorage'], function($, ajax, storage) {


Expand Down
110 changes: 61 additions & 49 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Moodle",
"devDependencies": {
"async": "1.5.2",
"eslint": "^3.0.1",
"eslint": "3.7.1",
"grunt": "1.0.1",
"grunt-contrib-less": "1.3.0",
"grunt-contrib-uglify": "1.0.1",
Expand Down

0 comments on commit 00c714f

Please sign in to comment.