mirror of
https://github.com/google/blockly.git
synced 2026-05-12 23:20:10 +02:00
d11cc047a4
* chore: fix 918 violations of comma-dangle rule * chore: fix 2 violations of comma-spacing * chore: fix 13 violations of padded-blocks * chore: fix 50 violations of block-spacing * chore: fix one violation of semi-spacing * chore: fix 4 violations of space-before-blocks * chore: fix 38 violations of object-curly-spacing * chore: fix 30 violations of key-spacing * chore: fix 3 violations of quote-props * chore: fix 5 violations of arrow-parens * chore: fix 8 violations of no-tabs * chore: allow uncommented helper functions in mocha tests * chore: fix several more lint errors * chore: tweak eslint configuration in core and tests * chore: rebuild for tests
78 lines
2.7 KiB
JSON
78 lines
2.7 KiB
JSON
{
|
|
"rules": {
|
|
"curly": ["error"],
|
|
"eol-last": ["error"],
|
|
"keyword-spacing": ["error"],
|
|
"linebreak-style": ["error", "unix"],
|
|
"max-len": [
|
|
"error",
|
|
{
|
|
"code": 100,
|
|
"tabWidth": 4,
|
|
"ignoreStrings": true,
|
|
"ignoreRegExpLiterals": true,
|
|
"ignoreUrls": true
|
|
}
|
|
],
|
|
"no-trailing-spaces": ["error", { "skipBlankLines": true }],
|
|
"no-unused-vars": [
|
|
"warn",
|
|
{
|
|
"args": "after-used",
|
|
// Ignore vars starting with an underscore.
|
|
"varsIgnorePattern": "^_",
|
|
// Ignore arguments starting with an underscore.
|
|
"argsIgnorePattern": "^_"
|
|
}
|
|
],
|
|
// Blockly uses for exporting symbols. no-self-assign added in eslint 5.
|
|
"no-self-assign": ["off"],
|
|
// Blockly uses single quotes except for JSON blobs, which must use double quotes.
|
|
"quotes": ["off"],
|
|
"semi": ["error", "always"],
|
|
// Blockly doesn't have space before function paren when defining functions.
|
|
"space-before-function-paren": ["error", "never"],
|
|
// Blockly doesn't have space before function paren when calling functions.
|
|
"func-call-spacing": ["error", "never"],
|
|
"space-infix-ops": ["error"],
|
|
// Blockly uses 'use strict' in files.
|
|
"strict": ["off"],
|
|
// Closure style allows redeclarations.
|
|
"no-redeclare": ["off"],
|
|
"valid-jsdoc": ["error", {"requireReturn": false}],
|
|
"no-console": ["off"],
|
|
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
|
|
"operator-linebreak": ["error", "after"],
|
|
"spaced-comment": ["error", "always", {
|
|
"block": {
|
|
"balanced": true
|
|
},
|
|
"exceptions": ["*"]
|
|
}],
|
|
// Blockly uses prefixes for optional arguments and test-only functions.
|
|
"camelcase": ["error", {
|
|
"properties": "never",
|
|
"allow": ["^opt_", "^_opt_", "^testOnly_"]
|
|
}],
|
|
// Use clang-format for indentation by running `npm run format`.
|
|
"indent": ["off"],
|
|
// Blockly uses capital letters for some non-constructor namespaces.
|
|
// Keep them for legacy reasons.
|
|
"new-cap": ["off"],
|
|
// Mostly use default rules for brace style, but allow single-line blocks.
|
|
"brace-style": ["error", "1tbs", { "allowSingleLine": true }]
|
|
},
|
|
"env": {
|
|
"es6": true,
|
|
"browser": true
|
|
},
|
|
"globals": {
|
|
"Blockly": true,
|
|
"goog": true,
|
|
"exports": true
|
|
},
|
|
"extends": [
|
|
"eslint:recommended"
|
|
]
|
|
}
|