From f54c176400eda60bb4271ac8a023dccff37fbcaa Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 30 Nov 2020 19:29:19 -0500 Subject: [PATCH] Infrastructure: Combine ESLint config at root (pull #1602) * Infrastructure: Combine ESLint config at root Pull settings from child .eslintrc.json files into "overridess" section at root. * chore: Temporarily push down no-unused-vars * chore: Push down no-undef suppression temporarily --- .eslintrc.json | 146 ++++++++++++++++++++++++++++++++++++++--- scripts/.eslintrc.json | 10 --- test/.eslintrc.json | 6 -- 3 files changed, 138 insertions(+), 24 deletions(-) delete mode 100644 scripts/.eslintrc.json delete mode 100644 test/.eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json index 004e91e3f0..2c6b908a87 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,18 +1,148 @@ { "extends": ["eslint:recommended", "plugin:prettier/recommended"], "env": { - "browser": true + "browser": true, + "es6": true }, "parserOptions": { "ecmaVersion": 6 }, "rules": { - "no-unused-vars": 0, - "no-undef": 0, - "no-restricted-properties": [2, { - "property": "findElements", - "message": "Please use t.context.queryElements()." - }], "strict": [2, "global"] - } + }, + "overrides": [ + { + "files": "test/**/*.js", + "parserOptions": { + "ecmaVersion": 8 + }, + "extends": ["plugin:ava/recommended"], + "env": { + "node": true + }, + "rules": { + "no-restricted-properties": [ + 2, + { + "property": "findElements", + "message": "Please use t.context.queryElements()." + } + ] + } + }, + { + "files": "scripts/*.js", + "env": { + "node": true + }, + "rules": { + "no-console": 0 + } + }, + { + "files": [ + "examples/accordion/js/accordion.js", + "examples/alert/js/alert.js", + "examples/checkbox/checkbox-1/js/checkbox.js", + "examples/checkbox/checkbox-2/js/checkboxMixed.js", + "examples/checkbox/checkbox-2/js/controlledCheckbox.js", + "examples/combobox/js/combobox-autocomplete.js", + "examples/combobox/js/combobox-datepicker.js", + "examples/combobox/js/grid-combo-example.js", + "examples/combobox/js/grid-combo.js", + "examples/dialog-modal/js/alertdialog.js", + "examples/dialog-modal/js/dialog.js", + "examples/disclosure/js/disclosureButton.js", + "examples/disclosure/js/disclosureMenu.js", + "examples/grid/js/dataGrid.js", + "examples/grid/js/dataGrids.js", + "examples/grid/js/layoutGrids.js", + "examples/js/examples.js", + "examples/landmarks/js/bootstrap-accessibility-2.js", + "examples/landmarks/js/show.js", + "examples/link/js/link.js", + "examples/listbox/js/listbox-collapsible.js", + "examples/listbox/js/listbox-scrollable.js", + "examples/listbox/js/listbox.js", + "examples/menu-button/js/menu-button-actions-active-descendant.js", + "examples/menu-button/js/menu-button-actions.js", + "examples/menu-button/js/menu-button-links.js", + "examples/menubar/js/menubar-editor.js", + "examples/menubar/js/menubar-navigation.js", + "examples/meter/js/meter.js", + "examples/slider/js/multithumb-slider.js", + "examples/slider/js/slider.js", + "examples/slider/js/text-slider.js", + "examples/slider/js/vertical-slider.js", + "examples/tabs/tabs-2/js/tabs.js", + "examples/toolbar/js/FontMenu.js", + "examples/toolbar/js/FontMenuButton.js", + "examples/toolbar/js/FontMenuItem.js", + "examples/toolbar/js/FormatToolbar.js", + "examples/toolbar/js/FormatToolbarItem.js", + "examples/treeview/treeview-1/js/treeitem.js", + "examples/treeview/treeview-2/js/treeitemLinks.js", + "respec-config.js", + "test/index.js", + "test/tests/accordion_accordion.js", + "test/tests/combobox_datepicker.js", + "test/tests/combobox_select-only.js", + "test/tests/dialog-modal_datepicker.js", + "test/tests/grid_LayoutGrids.js", + "test/tests/grid_dataGrids.js", + "test/tests/menu-button_actions.js", + "test/tests/menu-button_actions-active-descendant.js", + "test/tests/menubar_menubar-editor.js", + "test/tests/menubar_menubar-navigation.js", + "test/tests/slider_slider-2.js", + "test/tests/tabs_tabs-1.js", + "test/tests/tabs_tabs-2.js", + "test/util/assertHasFocus.js", + "test/tests/toolbar_toolbar.js", + "test/tests/treegrid_treegrid-1.js", + "test/tests/treeview_treeview-1a.js", + "test/tests/treeview_treeview-1b.js", + "test/tests/treeview_treeview-2a.js", + "test/tests/treeview_treeview-2b.js", + "test/util/assertAriaDescribedby.js", + "test/util/assertDotValue.js", + "test/util/report.js" + ], + "rules": { + "no-unused-vars": 0 + } + }, + { + "files": [ + "examples/checkbox/checkbox-2/js/checkboxMixed.js", + "examples/combobox/js/grid-combo-example.js", + "examples/combobox/js/grid-combo.js", + "examples/dialog-modal/js/alertdialog.js", + "examples/feed/js/main.js", + "examples/grid/js/dataGrids.js", + "examples/js/app.js", + "examples/landmarks/js/bootstrap-accessibility-2.js", + "examples/landmarks/js/show.js", + "examples/landmarks/js/tabs.js", + "examples/listbox/js/listbox-rearrangeable.js", + "examples/listbox/js/listbox-scrollable.js", + "examples/menubar/js/menubar-editor.js", + "examples/toolbar/js/FontMenu.js", + "examples/toolbar/js/FontMenuButton.js", + "examples/toolbar/js/FormatToolbar.js", + "examples/treeview/treeview-1/js/tree.js", + "examples/treeview/treeview-2/js/treeLinks.js", + "respec-config.js", + "test/tests/link_link.js", + "test/tests/menu-button_actions-active-descendant.js", + "test/tests/menu-button_actions.js", + "test/tests/menu-button_links.js", + "test/util/assertTabOrder.js", + "test/util/force-serial.js" + ], + "rules": { + "no-undef": 0 + } + } + ] } diff --git a/scripts/.eslintrc.json b/scripts/.eslintrc.json deleted file mode 100644 index 747f236352..0000000000 --- a/scripts/.eslintrc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "eslint:recommended", - "env": { - "node": true, - "es6": true - }, - "rules": { - "no-console": 0 - } -} diff --git a/test/.eslintrc.json b/test/.eslintrc.json deleted file mode 100644 index dd6115537c..0000000000 --- a/test/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../.eslintrc.json", "plugin:ava/recommended"], - "parserOptions": { - "ecmaVersion": 8 - } -}