2019-09-13 20:58:57 +00:00
module . exports = {
2019-12-18 14:30:11 +00:00
"env" : {
"browser" : true ,
2021-08-03 03:32:03 +00:00
"es2020" : true ,
2019-12-18 14:30:11 +00:00
} ,
"extends" : "eslint:recommended" ,
"globals" : {
"Atomics" : "readonly" ,
"SharedArrayBuffer" : "readonly" ,
"ClipboardItem" : "readonly" ,
2019-12-18 05:45:35 +00:00
2019-12-18 14:30:11 +00:00
// libraries
"$" : "readonly" ,
"jQuery" : "readonly" ,
"libtess" : "readonly" ,
"firebase" : "readonly" ,
"GIF" : "readonly" ,
"saveAs" : "readonly" ,
"Konami" : "readonly" ,
"YT" : "readonly" ,
"FontDetective" : "readonly" ,
2021-02-11 02:13:55 +00:00
"AnyPalette" : "readonly" ,
"ImageTracer" : "readonly" ,
2019-12-18 05:45:35 +00:00
2019-12-18 14:30:11 +00:00
/ *
// const
2021-02-11 02:13:55 +00:00
"MENU_DIVIDER" : "readonly" ,
2019-12-18 14:30:11 +00:00
"TAU" : "writable" ,
"is_pride_month" : "writable" ,
"default_tool" : "writable" ,
"default_canvas_width" : "writable" ,
"default_canvas_height" : "writable" ,
2021-02-11 02:13:55 +00:00
"default_magnification" : "writable" ,
"TOOL_FREE_FORM_SELECT" : "writable" ,
"TOOL_SELECT" : "writable" ,
"TOOL_ERASER" : "writable" ,
"TOOL_FILL" : "writable" ,
"TOOL_PICK_COLOR" : "writable" ,
"TOOL_MAGNIFIER" : "writable" ,
"TOOL_PENCIL" : "writable" ,
"TOOL_BRUSH" : "writable" ,
"TOOL_AIRBRUSH" : "writable" ,
"TOOL_TEXT" : "writable" ,
"TOOL_LINE" : "writable" ,
"TOOL_CURVE" : "writable" ,
"TOOL_RECTANGLE" : "writable" ,
"TOOL_POLYGON" : "writable" ,
"TOOL_ELLIPSE" : "writable" ,
"TOOL_ROUNDED_RECTANGLE" : "writable" ,
2019-12-18 05:45:35 +00:00
2019-12-18 14:30:11 +00:00
// global state: options
"brush_shape" : "writable" ,
"brush_size" : "writable" ,
"pencil_size" : "writable" ,
"eraser_size" : "writable" ,
"airbrush_size" : "writable" ,
"stroke_size" : "writable" ,
2021-02-11 02:13:55 +00:00
"stroke_color" : "writable" ,
"fill_color" : "writable" ,
"fill_color_k" : "writable" ,
"stroke_color_k" : "writable" ,
2019-12-18 14:30:11 +00:00
"tool_transparent_mode" : "writable" ,
"magnification" : "writable" ,
"transparency" : "writable" ,
"aliasing" : "writable" ,
"monochrome" : "writable" ,
2021-02-11 02:04:35 +00:00
"selected_colors" : "writable" ,
2019-12-18 14:30:11 +00:00
"palette" : "writable" ,
"polychrome_palette" : "writable" ,
"monochrome_palette" : "writable" ,
// global state: history
"undos" : "writable" ,
"redos" : "writable" ,
"current_history_node" : "writable" ,
"root_history_node" : "writable" ,
"history_node_to_cancel_to" : "writable" ,
// global state
"selection" : "writable" ,
"textbox" : "writable" ,
"pointer" : "writable" , // bad
"pointer_start" : "writable" ,
"pointer_previous" : "writable" ,
"pointers" : "writable" ,
"saved" : "writable" ,
"file_name" : "writable" ,
2021-02-11 02:13:55 +00:00
"file_format" : "writable" ,
2021-08-02 20:20:08 +00:00
"system_file_handle" : "writable" ,
2019-12-18 14:30:11 +00:00
"selected_tool" : "writable" ,
"selected_tools" : "writable" ,
"default_tool" : "writable" ,
"shift" : "writable" ,
"ctrl" : "writable" ,
"my_canvas_width" : "writable" ,
"my_canvas_height" : "writable" ,
"pointer" : "writable" ,
// references that may contain state in some ways
2021-02-11 02:00:38 +00:00
"main_canvas" : "writable" ,
"main_ctx" : "writable" ,
2019-12-18 14:30:11 +00:00
"helper_layer" : "writable" ,
"menus" : "writable" ,
"tools" : "writable" ,
"extra_tools" : "writable" ,
"$G" : "writable" ,
"$canvas" : "writable" ,
"$canvas_area" : "writable" ,
"$top" : "writable" ,
"$bottom" : "writable" ,
"$left" : "writable" ,
"$right" : "writable" ,
"$toolbox" : "writable" ,
"$colorbox" : "writable" ,
2021-11-20 02:00:22 +00:00
"MenuBar" : "writable" ,
2019-12-18 14:30:11 +00:00
"$ToolBox" : "writable" ,
"$ColorBox" : "writable" ,
"$Window" : "writable" ,
2020-03-24 14:20:05 +00:00
"$ToolWindow" : "writable" ,
2021-09-02 22:19:51 +00:00
"$DialogWindow" : "writable" ,
2021-12-04 21:08:53 +00:00
"Handles" : "writable" ,
2021-02-11 02:13:55 +00:00
"$ChooseShapeStyle" : "writable" ,
2019-12-18 14:30:11 +00:00
"OnCanvasSelection" : "writable" ,
"OnCanvasTextBox" : "writable" ,
// functions
"E" : "writable" ,
2021-02-11 02:13:55 +00:00
"get_rgba_from_color" : "writable" ,
2019-12-18 14:30:11 +00:00
"make_canvas" : "writable" ,
"debounce" : "writable" ,
"memoize_synchronous_function" : "writable" ,
"invert_rgb" : "off" ,
"get_theme" : "writable" ,
2020-12-10 22:59:27 +00:00
"get_tool_by_id" : "writable" ,
2019-12-18 14:30:11 +00:00
"redo" : "writable" ,
"undo" : "writable" ,
"undoable" : "writable" ,
"cancel" : "writable" ,
"deselect" : "writable" ,
"update_helper_layer" : "writable" ,
"show_error_message" : "writable" ,
"to_canvas_coords" : "writable" ,
"update_title" : "writable" ,
"get_help_folder_icon" : "writable" ,
"get_icon_for_tool" : "writable" ,
"draw_polygon" : "writable" ,
2021-02-11 02:13:55 +00:00
"draw_line" : "writable" ,
"draw_line_strip" : "writable" ,
"draw_bezier_curve" : "writable" ,
"draw_quadratic_curve" : "writable" ,
"draw_ellipse" : "writable" ,
"draw_rounded_rectangle" : "writable" ,
"draw_fill" : "writable" ,
"draw_noncontiguous_fill" : "writable" ,
"localize" : "writable" ,
"set_language" : "writable" ,
"get_language" : "writable" ,
"get_iso_language_name" : "writable" ,
"set_magnification" : "writable" ,
"make_css_cursor" : "writable" ,
"select_tool" : "writable" ,
"change_url_param" : "writable" ,
"set_theme" : "writable" ,
2019-12-18 14:30:11 +00:00
* /
} ,
"rules" : {
"no-undef" : 0 , // FOR NOW OKAY? there are just tons of globals at the moment
"no-unused-vars" : 0 , // ditto
2021-02-11 02:00:38 +00:00
2021-02-11 15:16:39 +00:00
// "eqeqeq": "error",
// "class-methods-use-this": "error",
"no-alert" : "error" ,
"no-extend-native" : "error" ,
"no-extra-bind" : "error" ,
"no-invalid-this" : "error" ,
"no-new-func" : "error" ,
"no-eval" : "error" ,
"no-new-wrappers" : "error" ,
"no-proto" : "error" ,
"no-return-assign" : "error" ,
"no-return-await" : "error" ,
"no-script-url" : "error" ,
"no-self-compare" : "error" ,
"no-sequences" : "error" ,
"no-throw-literal" : "error" ,
"no-unmodified-loop-condition" : "error" ,
// "no-unused-expressions": "error", // a && a() used a lot, could switch to a?.() etc. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
"no-useless-concat" : "error" ,
"prefer-promise-reject-errors" : "error" ,
"radix" : "error" ,
"require-await" : "error" ,
// "vars-on-top": "error",
"wrap-iife" : "error" ,
"no-label-var" : "error" ,
// "no-shadow": "error",
// "no-use-before-define": "error",
2022-01-18 18:33:44 +00:00
2021-02-11 02:13:55 +00:00
// To target specific variables to rename or otherwise address:
2021-02-11 15:16:39 +00:00
"no-restricted-globals" : [ "error" , "event" , "canvas" , "ctx" , "colors" , "i" , "j" , "k" , "x" , "y" , "z" , "width" , "height" , "w" , "h" ] ,
// Stylistic:
// @TODO: https://eslint.org/docs/rules/#stylistic-issues
// I want to see if I can merge some branches, maybe PRs first.
// "array-bracket-spacing": "error",
// "block-spacing": "error",
2019-12-18 14:30:11 +00:00
}
2019-09-13 20:58:57 +00:00
} ;