a40be5499e
Prettier is a code formatter for javascript/typescript. It's relatively common to see complaints about style in pull requests or inconsistent style getting in to Collabora Online. Also, without a formatter it's harder for editors to automatically format code in sensible and consistent ways Prettier doesn't have many options, but those which it does have I have set to the closest values to current behavior (e.g. single quotes) in order to minimize unnecessary changes This commit doesn't format all existing files. Doing so would cause blames, cherry-picks and diffs to become much less useful. Instead, we use browser/.beforeprettier to list all files that would need to be changed, and this file is ignored. You are encouraged but not required to set your editor's equivalent of 'editor.formatOnSaveMode' to only format changed lines This commit also does format of docstatefunctions.js, previously it did not in to check that an incorrectly-formatted file could fail CI. Now it does to make sure that formatting fixes the issue. This file was chosen because it is very new and very small. Change-Id: Ie6067f34aa658f887e149a08aebd0180b2354005 Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
57 lines
1.4 KiB
Text
57 lines
1.4 KiB
Text
{
|
|
"extends": [
|
|
"eslint:recommended",
|
|
"prettier"
|
|
],
|
|
"rules": {
|
|
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
|
|
"no-lonely-if": 2,
|
|
"no-underscore-dangle": 0,
|
|
"no-constant-condition": 0,
|
|
"strict": 0,
|
|
"no-shadow": 0,
|
|
"no-console": 0,
|
|
"no-control-regex": 0,
|
|
"no-useless-escape": 0,
|
|
"no-redeclare": 0,
|
|
/// Rules that are set to warn will fail in CI but not when building for development:
|
|
"no-debugger": 1,
|
|
"no-unreachable": 1,
|
|
"no-unused-vars": 1,
|
|
},
|
|
"globals": {
|
|
"L": true,
|
|
"module": false,
|
|
"define": false
|
|
},
|
|
"env": {
|
|
"browser": true
|
|
},
|
|
"parserOptions": {
|
|
"ecmaVersion": 2017
|
|
},
|
|
"overrides": [
|
|
{
|
|
"files": ["**/*.ts"],
|
|
"parser": "@typescript-eslint/parser",
|
|
"plugins": [
|
|
"@typescript-eslint"
|
|
],
|
|
"extends": [
|
|
"eslint:recommended",
|
|
"plugin:@typescript-eslint/eslint-recommended",
|
|
"plugin:@typescript-eslint/recommended"
|
|
],
|
|
"rules": {
|
|
"@typescript-eslint/no-unused-vars": "off",
|
|
"@typescript-eslint/no-inferrable-types": "off",
|
|
"no-var": "off",
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"@typescript-eslint/no-namespace": "off",
|
|
"no-inner-declarations": "off",
|
|
"no-constant-condition": "off",
|
|
"@typescript-eslint/triple-slash-reference": "off"
|
|
}
|
|
}
|
|
]
|
|
}
|