Commit abc7cc9a authored by Florian Müllner's avatar Florian Müllner Committed by Georges Basile Stavracas Neto

lint: Convert eslint JSON to YAML

gjs has changed its configuration to YAML, so switch to that format
to keep syncing possible.

GNOME/gnome-shell!818
parent 913990b9
{
"extends": [
"./lint/eslintrc-gjs.json",
"./lint/eslintrc-shell.json"
]
}
extends:
- ./lint/eslintrc-gjs.yml
- ./lint/eslintrc-shell.yml
......@@ -13,7 +13,7 @@ is_empty() {
}
run_eslint() {
ARGS_LEGACY='--config lint/eslintrc-legacy.json'
ARGS_LEGACY='--config lint/eslintrc-legacy.yml'
local extra_args=ARGS_$1
local output_var=OUTPUT_$1
......
{
"env": {
"es6": true
},
"extends": "eslint:recommended",
"rules": {
"array-bracket-newline": [
"error",
"consistent"
],
"array-bracket-spacing": [
"error",
"never"
],
"arrow-spacing": "error",
"brace-style": "error",
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
"indent": [
"error",
4,
{
"ignoredNodes": [
"CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child"
],
"MemberExpression": "off"
}
],
"key-spacing": [
"error",
{
"beforeColon": false,
"afterColon": true
}
],
"keyword-spacing": [
"error",
{
"before": true,
"after": true
}
],
"linebreak-style": [
"error",
"unix"
],
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-implicit-coercion": [
"error",
{
"allow": ["!!"]
}
],
"no-restricted-properties": [
"error",
{
"object": "Lang",
"property": "bind",
"message": "Use arrow notation or Function.prototype.bind()"
},
{
"object": "Lang",
"property": "Class",
"message": "Use ES6 classes"
}
],
"nonblock-statement-body-position": [
"error",
"below"
],
"object-curly-newline": [
"error",
{
"consistent": true
}
],
"object-curly-spacing": "error",
"prefer-template": "error",
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"semi": [
"error",
"always"
],
"semi-spacing": [
"error",
{
"before": false,
"after": true
}
],
"space-before-blocks": "error",
"space-infix-ops": [
"error",
{
"int32Hint": false
}
]
},
"globals": {
"ARGV": false,
"Debugger": false,
"GIRepositoryGType": false,
"imports": false,
"Intl": false,
"log": false,
"logError": false,
"print": false,
"printerr": false,
"window": false
},
"parserOptions": {
"ecmaVersion": 2017
}
}
---
env:
es6: true
extends: 'eslint:recommended'
rules:
array-bracket-newline:
- error
- consistent
array-bracket-spacing:
- error
- never
arrow-spacing: error
brace-style: error
comma-spacing:
- error
- before: false
after: true
indent:
- error
- 4
- ignoredNodes:
# Allow not indenting the body of GObject.registerClass, since in the
# future it's intended to be a decorator
- 'CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child'
# Allow dedenting chained member expressions
MemberExpression: 'off'
key-spacing:
- error
- beforeColon: false
afterColon: true
keyword-spacing:
- error
- before: true
after: true
linebreak-style:
- error
- unix
no-empty:
- error
- allowEmptyCatch: true
no-implicit-coercion:
- error
- allow:
- '!!'
no-restricted-properties:
- error
- object: Lang
property: bind
message: Use arrow notation or Function.prototype.bind()
- object: Lang
property: Class
message: Use ES6 classes
nonblock-statement-body-position:
- error
- below
object-curly-newline:
- error
- consistent: true
object-curly-spacing: error
prefer-template: error
quotes:
- error
- single
- avoidEscape: true
semi:
- error
- always
semi-spacing:
- error
- before: false
after: true
space-before-blocks: error
space-infix-ops:
- error
- int32Hint: false
globals:
ARGV: readonly
Debugger: readonly
GIRepositoryGType: readonly
imports: readonly
Intl: readonly
log: readonly
logError: readonly
print: readonly
printerr: readonly
window: readonly
parserOptions:
ecmaVersion: 2017
{
"rules": {
"indent": [
"error",
4,
{
"ignoredNodes": [
"CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child"
],
"CallExpression": { "arguments": "first" },
"ArrayExpression": "first",
"ObjectExpression": "first",
"MemberExpression": "off"
}
],
"prefer-template": "off",
"quotes": "off"
}
}
rules:
indent:
- error
- 4
- ignoredNodes:
- 'CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child'
CallExpression:
arguments: first
ArrayExpression: first
ObjectExpression: first
MemberExpression: off
prefer-template: off
quotes: off
{
"rules": {
"camelcase": [
"error",
{
"properties": "never",
"allow": ["^vfunc_", "^on_"]
}
],
"consistent-return": "error",
"key-spacing": [
"error",
{
"mode": "minimum",
"beforeColon": false,
"afterColon": true
}
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "_$"
}
],
"object-curly-spacing": [
"error",
"always"
],
"prefer-arrow-callback": "error"
},
"overrides": [
{
"files": "js/**",
"excludedFiles": ["js/extensionPrefs/*", "js/portalHelper/*"],
"globals": {
"global": false,
"_": false,
"C_": false,
"N_": false,
"ngettext": false
}
}
]
}
rules:
camelcase:
- error
- properties: never
allow: [^vfunc_, ^on_]
consistent-return: error
key-spacing:
- error
- mode: minimum
beforeColon: false
afterColon: true
no-unused-vars:
- error
- argsIgnorePattern: ^_
varsIgnorePattern: _$
object-curly-spacing:
- error
- always
prefer-arrow-callback: error
overrides:
- files: js/**
excludedFiles:
- js/extensionPrefs/*
- js/portalHelper/*
globals:
global: readonly
_: readonly
C_: readonly
N_: readonly
ngettext: readonly
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment