Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Nov 10, 2023
1 parent 85747ee commit 80a4f42
Show file tree
Hide file tree
Showing 6 changed files with 2,036 additions and 7 deletions.
44 changes: 44 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

module.exports = {
"root": true,
"ignorePatterns": [
"/node_modules/*",
"/vendor/*",
],
"env": {
"browser": true,
"es6": true,
"jquery": true,
},
"extends": "eslint:recommended",
"globals": {
"CFG_GLPI": true,
"GLPI_PLUGINS_PATH": true,
"__": true,
"_n": true,
"_x": true,
"_nx": true
},
"parserOptions": {
"ecmaVersion": 8,
},
"plugins": [
"@stylistic/js",
],
"rules": {
"no-console": ["error", {"allow": ["warn", "error"]}],
"no-unused-vars": ["error", {"vars": "local"}],
"@stylistic/js/eol-last": ["error", "always"],
"@stylistic/js/indent": ["error", 4],
"@stylistic/js/linebreak-style": ["error", "unix"],
"@stylistic/js/semi": ["error", "always"],
},
"overrides": [
{
"files": [".eslintrc.js"],
"env": {
"node": true
}
},
],
};
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
dist/
node_modules/
vendor/
.gh_token
*.min.*
.DS_Store
1 change: 1 addition & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<ruleset>
<file>.</file>
<exclude-pattern>/.git/</exclude-pattern>
<exclude-pattern type="relative">^node_modules/</exclude-pattern>
<exclude-pattern type="relative">^vendor/</exclude-pattern>

<arg name="colors" />
Expand Down
10 changes: 5 additions & 5 deletions js/credit.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@

var PluginCredit = {
propagateDefaultVoucherValue: function (dropdown) {
var value = $(dropdown).val();
var text = $(dropdown).find('option:selected').text();
$('select[name="plugin_credit_entities_id_followups"]').append(new Option(text, value, false, true)).trigger('change');
$('select[name="plugin_credit_entities_id_tasks"]').append(new Option(text, value, false, true)).trigger('change');
$('select[name="plugin_credit_entities_id_solutions"]').append(new Option(text, value, false, true)).trigger('change');
var value = $(dropdown).val();
var text = $(dropdown).find('option:selected').text();
$('select[name="plugin_credit_entities_id_followups"]').append(new Option(text, value, false, true)).trigger('change');
$('select[name="plugin_credit_entities_id_tasks"]').append(new Option(text, value, false, true)).trigger('change');
$('select[name="plugin_credit_entities_id_solutions"]').append(new Option(text, value, false, true)).trigger('change');
}
};
Loading

0 comments on commit 80a4f42

Please sign in to comment.