mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-16 10:34:07 +02:00
Extend ESLint to cover all JS files and drop JSCS.
This commit is contained in:
42
js/.jscsrc
42
js/.jscsrc
@@ -1,42 +0,0 @@
|
|||||||
{
|
|
||||||
"disallowEmptyBlocks": true,
|
|
||||||
"disallowKeywords": ["with"],
|
|
||||||
"disallowMixedSpacesAndTabs": true,
|
|
||||||
"disallowMultipleLineStrings": true,
|
|
||||||
"disallowMultipleVarDecl": true,
|
|
||||||
"disallowQuotedKeysInObjects": "allButReserved",
|
|
||||||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
|
|
||||||
"disallowSpaceBeforeBinaryOperators": [","],
|
|
||||||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
|
|
||||||
"disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
|
|
||||||
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
|
|
||||||
"disallowSpacesInsideArrayBrackets": true,
|
|
||||||
"disallowSpacesInsideParentheses": true,
|
|
||||||
"disallowTrailingComma": true,
|
|
||||||
"disallowTrailingWhitespace": true,
|
|
||||||
"requireCamelCaseOrUpperCaseIdentifiers": true,
|
|
||||||
"requireCapitalizedConstructors": true,
|
|
||||||
"requireCommaBeforeLineBreak": true,
|
|
||||||
"requireDollarBeforejQueryAssignment": true,
|
|
||||||
"requireDotNotation": true,
|
|
||||||
"requireLineFeedAtFileEnd": true,
|
|
||||||
"requirePaddingNewLinesAfterUseStrict": true,
|
|
||||||
"requirePaddingNewLinesBeforeExport": true,
|
|
||||||
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
|
|
||||||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
|
|
||||||
"requireSpaceAfterLineComment": true,
|
|
||||||
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
|
|
||||||
"requireSpaceBetweenArguments": true,
|
|
||||||
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true, "beforeOpeningRoundBrace": true, "allExcept": ["shorthand"] },
|
|
||||||
"requireSpacesInConditionalExpression": true,
|
|
||||||
"requireSpacesInForStatement": true,
|
|
||||||
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
|
|
||||||
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
|
|
||||||
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
|
|
||||||
"requireSpacesInsideObjectBrackets": "allButNested",
|
|
||||||
"validateAlignedFunctionParameters": true,
|
|
||||||
"validateIndentation": 2,
|
|
||||||
"validateLineBreaks": "LF",
|
|
||||||
"validateNewlineAfterArrayElements": true,
|
|
||||||
"validateQuoteMarks": "'"
|
|
||||||
}
|
|
@@ -10,6 +10,7 @@
|
|||||||
"ecmaVersion": 5,
|
"ecmaVersion": 5,
|
||||||
"sourceType": "script"
|
"sourceType": "script"
|
||||||
},
|
},
|
||||||
|
"extends": "../.eslintrc.json",
|
||||||
"rules": {
|
"rules": {
|
||||||
// Best Practices
|
// Best Practices
|
||||||
"consistent-return": "off",
|
"consistent-return": "off",
|
||||||
@@ -23,12 +24,18 @@
|
|||||||
// Strict Mode
|
// Strict Mode
|
||||||
"strict": "off",
|
"strict": "off",
|
||||||
|
|
||||||
|
// NodeJS and CommonJS
|
||||||
|
"global-require": "off",
|
||||||
|
"no-process-env": "off",
|
||||||
|
"no-process-exit": "off",
|
||||||
|
|
||||||
// Stylistic Issues
|
// Stylistic Issues
|
||||||
"brace-style": "off",
|
"brace-style": "off",
|
||||||
"func-style": "off",
|
"func-style": "off",
|
||||||
"max-statements-per-line": "off",
|
"max-statements-per-line": "off",
|
||||||
"object-curly-newline": "off",
|
"object-curly-newline": "off",
|
||||||
"object-property-newline": "off",
|
"object-property-newline": "off",
|
||||||
|
"spaced-comment": "off",
|
||||||
|
|
||||||
// ECMAScript 6
|
// ECMAScript 6
|
||||||
"no-var": "off",
|
"no-var": "off",
|
||||||
|
@@ -20,8 +20,7 @@
|
|||||||
"change-version": "node grunt/change-version.js",
|
"change-version": "node grunt/change-version.js",
|
||||||
"clean-css": "cleancss --skip-advanced --source-map --output dist/css/bootstrap.min.css dist/css/bootstrap.css && cleancss --skip-advanced --source-map --output dist/css/bootstrap-grid.min.css dist/css/bootstrap-grid.css && cleancss --skip-advanced --source-map --output dist/css/bootstrap-reboot.min.css dist/css/bootstrap-reboot.css",
|
"clean-css": "cleancss --skip-advanced --source-map --output dist/css/bootstrap.min.css dist/css/bootstrap.css && cleancss --skip-advanced --source-map --output dist/css/bootstrap-grid.min.css dist/css/bootstrap-grid.css && cleancss --skip-advanced --source-map --output dist/css/bootstrap-reboot.min.css dist/css/bootstrap-reboot.css",
|
||||||
"clean-css-docs": "cleancss --skip-advanced --source-map --output docs/assets/css/docs.min.css docs/assets/css/docs.min.css",
|
"clean-css-docs": "cleancss --skip-advanced --source-map --output docs/assets/css/docs.min.css docs/assets/css/docs.min.css",
|
||||||
"eslint": "eslint --ignore-path .eslintignore js",
|
"eslint": "eslint --ignore-path .eslintignore js && eslint --config js/tests/.eslintrc.json --env node grunt Gruntfile.js && eslint --config js/tests/.eslintrc.json docs/assets/js/src docs/assets/js/ie-emulation-modes-warning.js docs/assets/js/ie10-viewport-bug-workaround.js",
|
||||||
"jscs": "jscs --config=js/.jscsrc js/src js/tests/unit docs/assets/js/src grunt Gruntfile.js docs/assets/js/ie-emulation-modes-warning.js docs/assets/js/ie10-viewport-bug-workaround.js",
|
|
||||||
"htmlhint": "htmlhint --config docs/.htmlhintrc _gh_pages/",
|
"htmlhint": "htmlhint --config docs/.htmlhintrc _gh_pages/",
|
||||||
"postcss": "postcss --config grunt/postcss.js --replace dist/css/*.css",
|
"postcss": "postcss --config grunt/postcss.js --replace dist/css/*.css",
|
||||||
"postcss-docs": "postcss --config grunt/postcss.js --no-map --replace docs/assets/css/docs.min.css && postcss --config grunt/postcss.js --no-map --replace docs/examples/**/*.css",
|
"postcss-docs": "postcss --config grunt/postcss.js --no-map --replace docs/assets/css/docs.min.css && postcss --config grunt/postcss.js --no-map --replace docs/examples/**/*.css",
|
||||||
@@ -30,7 +29,7 @@
|
|||||||
"uglify": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
|
"uglify": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
|
||||||
"uglify-docs": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output docs/assets/js/docs.min.js docs/assets/js/vendor/*.js docs/assets/js/src/application.js",
|
"uglify-docs": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output docs/assets/js/docs.min.js docs/assets/js/vendor/*.js docs/assets/js/src/application.js",
|
||||||
"update-shrinkwrap": "npm shrinkwrap --dev && shx mv ./npm-shrinkwrap.json ./grunt/npm-shrinkwrap.json",
|
"update-shrinkwrap": "npm shrinkwrap --dev && shx mv ./npm-shrinkwrap.json ./grunt/npm-shrinkwrap.json",
|
||||||
"test": "npm run eslint && npm run jscs && grunt test"
|
"test": "npm run eslint && grunt test"
|
||||||
},
|
},
|
||||||
"style": "dist/css/bootstrap.css",
|
"style": "dist/css/bootstrap.css",
|
||||||
"sass": "scss/bootstrap.scss",
|
"sass": "scss/bootstrap.scss",
|
||||||
@@ -73,7 +72,6 @@
|
|||||||
"grunt-stamp": "^0.3.0",
|
"grunt-stamp": "^0.3.0",
|
||||||
"htmlhint": "^0.9.13",
|
"htmlhint": "^0.9.13",
|
||||||
"is-travis": "^1.0.0",
|
"is-travis": "^1.0.0",
|
||||||
"jscs": "^3.0.7",
|
|
||||||
"load-grunt-tasks": "^3.5.2",
|
"load-grunt-tasks": "^3.5.2",
|
||||||
"postcss-cli": "^2.6.0",
|
"postcss-cli": "^2.6.0",
|
||||||
"postcss-flexbugs-fixes": "^2.0.0",
|
"postcss-flexbugs-fixes": "^2.0.0",
|
||||||
|
Reference in New Issue
Block a user