1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

Fix last prefer-const, decrease max warnings

and make prefer-const an error
This commit is contained in:
David Baker
2017-01-19 18:24:28 +00:00
parent dc74a2326f
commit 80129e7483
3 changed files with 5 additions and 5 deletions

View File

@@ -11,12 +11,13 @@ module.exports = {
}, },
extends: ["eslint:recommended", "google"], extends: ["eslint:recommended", "google"],
rules: { rules: {
// rules we've always adhered to // rules we've always adhered to or now do
"max-len": ["error", { "max-len": ["error", {
code: 90, code: 90,
ignoreComments: true, ignoreComments: true,
}], }],
curly: ["error", "multi-line"], curly: ["error", "multi-line"],
"prefer-const": ["error"],
// loosen jsdoc requirements a little // loosen jsdoc requirements a little
"require-jsdoc": ["error", { "require-jsdoc": ["error", {
@@ -55,7 +56,6 @@ module.exports = {
"padded-blocks": ["warn"], "padded-blocks": ["warn"],
"no-extend-native": ["warn"], "no-extend-native": ["warn"],
"camelcase": ["warn"], "camelcase": ["warn"],
"prefer-const": ["warn"],
} }
} }

View File

@@ -11,7 +11,7 @@
"build": "babel -s -d lib src && rimraf dist && mkdir dist && browserify --exclude olm browser-index.js -o dist/browser-matrix.js --ignore-missing && uglifyjs -c -m -o dist/browser-matrix.min.js dist/browser-matrix.js", "build": "babel -s -d lib src && rimraf dist && mkdir dist && browserify --exclude olm browser-index.js -o dist/browser-matrix.js --ignore-missing && uglifyjs -c -m -o dist/browser-matrix.min.js dist/browser-matrix.js",
"dist": "npm run build", "dist": "npm run build",
"watch": "watchify --exclude olm browser-index.js -o dist/browser-matrix-dev.js -v", "watch": "watchify --exclude olm browser-index.js -o dist/browser-matrix-dev.js -v",
"lint": "eslint --max-warnings 122 src spec", "lint": "eslint --max-warnings 121 src spec",
"prepublish": "npm run build && git rev-parse HEAD > git-revision.txt" "prepublish": "npm run build && git rev-parse HEAD > git-revision.txt"
}, },
"repository": { "repository": {

View File

@@ -414,7 +414,7 @@ module.exports.runPolyfills = function() {
// Reference: http://es5.github.io/#x15.4.4.19 // Reference: http://es5.github.io/#x15.4.4.19
if (!Array.prototype.map) { if (!Array.prototype.map) {
Array.prototype.map = function(callback, thisArg) { Array.prototype.map = function(callback, thisArg) {
let T, A, k; let T, k;
if (this === null || this === undefined) { if (this === null || this === undefined) {
throw new TypeError(' this is null or not defined'); throw new TypeError(' this is null or not defined');
@@ -443,7 +443,7 @@ module.exports.runPolyfills = function() {
// 6. Let A be a new array created as if by the expression new Array(len) // 6. Let A be a new array created as if by the expression new Array(len)
// where Array is the standard built-in constructor with that name and // where Array is the standard built-in constructor with that name and
// len is the value of len. // len is the value of len.
A = new Array(len); const A = new Array(len);
// 7. Let k be 0 // 7. Let k be 0
k = 0; k = 0;