mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-17 14:18:24 +01:00
Merge pull request #5543 from hanakin/ticket/15515
[ticket/15515] Overhaul JS linting/testing with xo/eslint
This commit is contained in:
commit
8a87d2bd5b
78
.jscsrc
78
.jscsrc
@ -1,78 +0,0 @@
|
||||
|
||||
{
|
||||
"excludeFiles": ["node_modules/**", "**/build/**"],
|
||||
"requireCurlyBraces": [
|
||||
"if", "else", "for", "while", "do", "try", "catch"
|
||||
],
|
||||
"requireSpaceBeforeKeywords": [
|
||||
"else", "while", "catch"
|
||||
],
|
||||
"requireSpaceAfterKeywords": [
|
||||
"do", "for", "if", "else", "switch", "case", "try", "catch", "while", "return", "typeof"
|
||||
],
|
||||
"requireSpaceBeforeBlockStatements": true,
|
||||
"requireParenthesesAroundIIFE": true,
|
||||
"requireSpacesInConditionalExpression": {
|
||||
"afterTest": true,
|
||||
"beforeConsequent": true,
|
||||
"afterConsequent": true,
|
||||
"beforeAlternate": true
|
||||
},
|
||||
"requireSpacesInAnonymousFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"disallowSpacesInNamedFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"requireSpacesInFunction": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"disallowSpacesInCallExpression": true,
|
||||
"requireBlocksOnNewline": true,
|
||||
"requirePaddingNewlinesBeforeKeywords": ["case"],
|
||||
"disallowEmptyBlocks": true,
|
||||
"disallowSpacesInsideArrayBrackets": "nested",
|
||||
"disallowSpacesInsideParentheses": true,
|
||||
"requireSpacesInsideObjectBrackets": "all",
|
||||
"disallowQuotedKeysInObjects": "allButReserved",
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
"requireSpaceBeforeObjectValues": true,
|
||||
"requireCommaBeforeLineBreak": true,
|
||||
"requireOperatorBeforeLineBreak": [
|
||||
"?", "=", "+", "-", "/", "*", "===", "!==", ">", ">=", "<", "<="
|
||||
],
|
||||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
|
||||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
|
||||
"requireSpaceBeforeBinaryOperators": [
|
||||
"=", "+", "+=", "-", "-=", "/", "/=", "*", "*=", "===", "!==", "<", "<=", ">", ">="
|
||||
],
|
||||
"requireSpaceAfterBinaryOperators": [
|
||||
"=", "+", "+=", "-", "-=", "/", "/=", "*", "*=", "===", "!==", "<", "<=", ">", ">="
|
||||
],
|
||||
"disallowKeywords": ["with"],
|
||||
"disallowMultipleLineStrings": true,
|
||||
"disallowMixedSpacesAndTabs": "smart",
|
||||
"disallowTrailingWhitespace": true,
|
||||
"disallowTrailingComma": true,
|
||||
"disallowKeywordsOnNewLine": ["else"],
|
||||
"requireLineFeedAtFileEnd": true,
|
||||
"maximumLineLength": {
|
||||
"value": 120,
|
||||
"tabSize": 4,
|
||||
"allowUrlComments": true,
|
||||
"allowRegex": true
|
||||
},
|
||||
"requireCapitalizedConstructors": true,
|
||||
"requireDotNotation": true,
|
||||
"disallowYodaConditions": true,
|
||||
"requireSpaceAfterLineComment": {
|
||||
"allExcept": ["#", "="]
|
||||
},
|
||||
"disallowNewlineBeforeBlockStatements": true,
|
||||
"validateQuoteMarks": {
|
||||
"mark": "'",
|
||||
"escape": true
|
||||
},
|
||||
"validateParameterSeparator": ", ",
|
||||
"safeContextKeyword": ["that"]
|
||||
}
|
25
.jshintrc
25
.jshintrc
@ -1,25 +0,0 @@
|
||||
|
||||
{
|
||||
"bitwise": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"es3": true,
|
||||
"forin": false,
|
||||
"freeze": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
"nonbsp": true,
|
||||
"undef": true,
|
||||
"unused": true,
|
||||
"strict": true,
|
||||
|
||||
"browser": true,
|
||||
"devel": true,
|
||||
"jquery": true,
|
||||
|
||||
"globals": {
|
||||
"JSON": true,
|
||||
"phpbb": true
|
||||
}
|
||||
}
|
@ -12,7 +12,7 @@ function parse_document(container)
|
||||
var test = document.createElement('div'),
|
||||
oldBrowser = (typeof test.style.borderRadius == 'undefined');
|
||||
|
||||
delete test;
|
||||
test.remove();
|
||||
|
||||
/**
|
||||
* Navigation
|
||||
|
25
travis/check-js.sh
Executable file
25
travis/check-js.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This file is part of the phpBB Forum Software package.
|
||||
#
|
||||
# @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
# @license GNU General Public License, version 2 (GPL-2.0)
|
||||
#
|
||||
# For full copyright and license information, please see
|
||||
# the docs/CREDITS.txt file.
|
||||
#
|
||||
set -e
|
||||
set +x
|
||||
|
||||
NOTESTS=$1
|
||||
|
||||
if [ "$NOTESTS" == '1' ]
|
||||
then
|
||||
npm install -g > /dev/null
|
||||
npm install > /dev/null
|
||||
set -x
|
||||
node_modules/xo/cli.js "phpBB/adm/style/*.js"
|
||||
node_modules/xo/cli.js "phpBB/assets/javascript/*.js"
|
||||
node_modules/xo/cli.js "phpBB/style/all/js/*.js"
|
||||
node_modules/xo/cli.js "phpBB/style/prosilver/template/*.js"
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user