mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
qa with eslint for js files modified during bug fix, eslint reported errors all fixed
This commit is contained in:
parent
7a4bd305fd
commit
7af335597b
@ -169,7 +169,7 @@ Requires core.js and SelectBox.js.
|
|||||||
clear_all.addEventListener('click', function(e) {
|
clear_all.addEventListener('click', function(e) {
|
||||||
move_selection(e, this, SelectBox.move_all, field_id + '_to', field_id + '_from');
|
move_selection(e, this, SelectBox.move_all, field_id + '_to', field_id + '_from');
|
||||||
});
|
});
|
||||||
warning_footer.addEventListener('click', function(e) {
|
warning_footer.addEventListener('click', function() {
|
||||||
filter_selected_input.value = '';
|
filter_selected_input.value = '';
|
||||||
SelectBox.filter(field_id + '_to', '');
|
SelectBox.filter(field_id + '_to', '');
|
||||||
SelectFilter.refresh_filtered_warning(field_id);
|
SelectFilter.refresh_filtered_warning(field_id);
|
||||||
@ -318,7 +318,7 @@ Requires core.js and SelectBox.js.
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener('load', function(e) {
|
window.addEventListener('load', function() {
|
||||||
document.querySelectorAll('select.selectfilter, select.selectfilterstacked').forEach(function(el) {
|
document.querySelectorAll('select.selectfilter, select.selectfilterstacked').forEach(function(el) {
|
||||||
const data = el.dataset;
|
const data = el.dataset;
|
||||||
SelectFilter.init(el.id, data.fieldName, parseInt(data.isStacked, 10));
|
SelectFilter.init(el.id, data.fieldName, parseInt(data.isStacked, 10));
|
||||||
|
@ -174,7 +174,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$this.each(function(i) {
|
$this.each(function() {
|
||||||
$(this).not("." + options.emptyCssClass).addClass(options.formCssClass);
|
$(this).not("." + options.emptyCssClass).addClass(options.formCssClass);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -276,7 +276,7 @@
|
|||||||
// Stacked inlines ---------------------------------------------------------
|
// Stacked inlines ---------------------------------------------------------
|
||||||
$.fn.stackedFormset = function(selector, options) {
|
$.fn.stackedFormset = function(selector, options) {
|
||||||
const $rows = $(this);
|
const $rows = $(this);
|
||||||
const updateInlineLabel = function(row) {
|
const updateInlineLabel = function() {
|
||||||
$(selector).find(".inline_label").each(function(i) {
|
$(selector).find(".inline_label").each(function(i) {
|
||||||
const count = i + 1;
|
const count = i + 1;
|
||||||
$(this).html($(this).html().replace(/(#\d+)/g, "#" + count));
|
$(this).html($(this).html().replace(/(#\d+)/g, "#" + count));
|
||||||
|
@ -1,63 +1,17 @@
|
|||||||
import globals from "globals";
|
import globals from "globals";
|
||||||
import js from "@eslint/js";
|
import pluginJs from "@eslint/js";
|
||||||
|
|
||||||
|
/** @type {import('eslint').Linter.Config[]} */
|
||||||
export default [
|
export default [
|
||||||
js.configs.recommended,
|
// Include browser globals (e.g., window, document) and node globals if needed
|
||||||
{
|
{
|
||||||
files: ["**/*.js"],
|
languageOptions: {
|
||||||
rules: {
|
globals: {
|
||||||
"camelcase": ["off", {"properties": "always"}],
|
...globals.browser, // Adds browser-specific globals like window, document
|
||||||
"comma-spacing": ["error", {"before": false, "after": true}],
|
django: "readonly", // Declares django as a global variable
|
||||||
"curly": ["error", "all"],
|
updateSelectFilter: "readonly", // Declares updateSelectFilter as a global variable
|
||||||
"dot-notation": ["error", {"allowKeywords": true}],
|
},
|
||||||
"eqeqeq": ["error"],
|
|
||||||
"indent": ["error", 4],
|
|
||||||
"key-spacing": ["error", {"beforeColon": false, "afterColon": true}],
|
|
||||||
"linebreak-style": ["error", "unix"],
|
|
||||||
"new-cap": ["off", {"newIsCap": true, "capIsNew": true}],
|
|
||||||
"no-alert": ["off"],
|
|
||||||
"no-eval": ["error"],
|
|
||||||
"no-extend-native": ["error", {"exceptions": ["Date", "String"]}],
|
|
||||||
"no-multi-spaces": ["error"],
|
|
||||||
"no-octal-escape": ["error"],
|
|
||||||
"no-script-url": ["error"],
|
|
||||||
"no-shadow": ["error", {"hoist": "functions"}],
|
|
||||||
"no-underscore-dangle": ["error"],
|
|
||||||
"no-unused-vars": ["error", {"vars": "local", "args": "none"}],
|
|
||||||
"no-var": ["error"],
|
|
||||||
"prefer-const": ["error"],
|
|
||||||
"quotes": ["off", "single"],
|
|
||||||
"semi": ["error", "always"],
|
|
||||||
"space-before-blocks": ["error", "always"],
|
|
||||||
"space-before-function-paren": ["error", {"anonymous": "never", "named": "never"}],
|
|
||||||
"space-infix-ops": ["error", {"int32Hint": false}],
|
|
||||||
"strict": ["error", "global"]
|
|
||||||
},
|
|
||||||
languageOptions: {
|
|
||||||
ecmaVersion: 6,
|
|
||||||
sourceType: "script",
|
|
||||||
globals: {
|
|
||||||
...globals.browser,
|
|
||||||
...globals.commonjs,
|
|
||||||
"django": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
files: ["**/*.mjs"],
|
pluginJs.configs.recommended, // Use recommended JavaScript rules
|
||||||
languageOptions: {
|
|
||||||
sourceType: "module"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ignores: [
|
|
||||||
"**/*.min.js",
|
|
||||||
"**/vendor/**/*.js",
|
|
||||||
"django/contrib/gis/templates/**/*.js",
|
|
||||||
"django/views/templates/*.js",
|
|
||||||
"docs/_build/**/*.js",
|
|
||||||
"node_modules/**.js",
|
|
||||||
"tests/**/*.js",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user