Skip to content

Commit 00c714f

Browse files
committedOct 7, 2016
MDL-55835 eslint: bump to v3.7.1
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)
1 parent d9520bc commit 00c714f

File tree

4 files changed

+76
-54
lines changed

4 files changed

+76
-54
lines changed
 

‎.eslintrc

+12-4
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
'no-inner-declarations': 'error',
3232
'no-invalid-regexp': 'error',
3333
'no-irregular-whitespace': 'error',
34-
'no-negated-in-lhs': 'error',
3534
'no-obj-calls': 'error',
3635
'no-prototype-builtins': 'off',
3736
'no-regex-spaces': 'error',
3837
'no-sparse-arrays': 'error',
3938
'no-unexpected-multiline': 'error',
4039
'no-unreachable': 'warn',
4140
'no-unsafe-finally': 'error',
41+
'no-unsafe-negation': 'error',
4242
'use-isnan': 'error',
4343
'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
4444
'valid-typeof': 'error',
@@ -63,6 +63,7 @@
6363
'no-extra-bind': 'warn',
6464
'no-fallthrough': 'error',
6565
'no-floating-decimal': 'warn',
66+
'no-global-assign': 'warn',
6667
// Enabled by grunt for AMD modules: 'no-implicit-globals': 'error',
6768
'no-implied-eval': 'error',
6869
'no-invalid-this': 'error',
@@ -71,7 +72,6 @@
7172
'no-loop-func': 'error',
7273
'no-multi-spaces': 'warn',
7374
'no-multi-str': 'error',
74-
'no-native-reassign': 'warn',
7575
'no-new-func': 'error',
7676
'no-new-wrappers': 'error',
7777
'no-octal': 'error',
@@ -96,7 +96,7 @@
9696
'no-delete-var': 'error',
9797
'no-undef': 'error',
9898
'no-undef-init': 'error',
99-
'no-unused-vars': ['error', { 'caughtErrors': 'none', 'argsIgnorePattern': "(e|event)" }],
99+
'no-unused-vars': ['error', { 'caughtErrors': 'none' }],
100100

101101
// === Stylistic Issues ===
102102
'array-bracket-spacing': 'warn',
@@ -108,6 +108,7 @@
108108
'computed-property-spacing': 'error',
109109
'consistent-this': 'off',
110110
'eol-last': 'off',
111+
'func-call-spacing': ['warn', 'never'],
111112
'func-names': 'off',
112113
'func-style': 'off',
113114
// indent currently not doing well with our wrapping style, so disabled.
@@ -140,7 +141,7 @@
140141
'no-nested-ternary': 'warn',
141142
'no-new-object': 'off',
142143
'no-plusplus': 'off',
143-
'no-spaced-func': 'warn',
144+
'no-tabs': 'error',
144145
'no-ternary': 'off',
145146
'no-trailing-spaces': 'error',
146147
'no-underscore-dangle': 'off',
@@ -168,5 +169,12 @@
168169
'spaced-comment': 'warn',
169170
'unicode-bom': 'error',
170171
'wrap-regex': 'off',
172+
173+
// === Deprecations ===
174+
"no-restricted-properties": ['warn', {
175+
'object': 'M',
176+
'property': 'str',
177+
'message': 'Use AMD module "core/str" or M.util.get_string()'
178+
}],
171179
}
172180
}

‎lib/amd/src/str.js

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2525
* @since 2.9
2626
*/
27+
// Disable no-restriced-properties because M.str is expected here:
28+
/* eslint-disable no-restricted-properties */
2729
define(['jquery', 'core/ajax', 'core/localstorage'], function($, ajax, storage) {
2830

2931

‎npm-shrinkwrap.json

+61-49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Moodle",
55
"devDependencies": {
66
"async": "1.5.2",
7-
"eslint": "^3.0.1",
7+
"eslint": "3.7.1",
88
"grunt": "1.0.1",
99
"grunt-contrib-less": "1.3.0",
1010
"grunt-contrib-uglify": "1.0.1",

0 commit comments

Comments
 (0)
Please sign in to comment.