[Docs] add browserlist and linting capability (#4811)

* add browserlist to package.json

* add browserlist linting

* add eslint compat package

* Add blurb about browser support

* add ios safari

* remove node

* add comment and simple disable

Co-authored-by: unlikelyzero <jchill2@gmail.com>
Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov>
Co-authored-by: Scott Bell <scott@traclabs.com>
This commit is contained in:
John Hill 2022-03-21 12:27:18 -07:00 committed by GitHub
parent d80b692354
commit 7b2ff8fa15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 0 deletions

View File

@ -11,6 +11,7 @@ module.exports = {
},
"extends": [
"eslint:recommended",
"plugin:compat/recommended",
"plugin:vue/recommended",
"plugin:you-dont-need-lodash-underscore/compatible"
],

View File

@ -65,6 +65,12 @@ Open MCT is built using [`npm`](http://npmjs.com/) and [`webpack`](https://webpa
See our documentation for a guide on [building Applications with Open MCT](https://github.com/nasa/openmct/blob/master/API.md#starting-an-open-mct-application).
## Compatibility
This is a fast moving project and we do our best to test and support the widest possible range of browsers, operating systems, and nodejs APIs. We have a published list of support available in our package.json's `browserslist` key.
If you encounter an issue with a particular browser, OS, or nodejs API, please file a [GitHub issue](https://github.com/nasa/openmct/issues/new/choose)
## Plugins
Open MCT can be extended via plugins that make calls to the Open MCT API. A plugin is a group

View File

@ -18,6 +18,7 @@
"d3-scale": "1.0.x",
"d3-selection": "1.3.x",
"eslint": "8.11.0",
"eslint-plugin-compat": "4.0.2",
"eslint-plugin-playwright": "0.8.0",
"eslint-plugin-vue": "8.5.0",
"eslint-plugin-you-dont-need-lodash-underscore": "6.12.0",
@ -107,6 +108,13 @@
"engines": {
"node": ">=12.22.0"
},
"browserslist": [
"Firefox ESR",
"not IE 11",
"last 2 Chrome versions",
"unreleased Chrome versions",
"ios_saf > 15"
],
"author": "",
"license": "Apache-2.0",
"private": true

View File

@ -454,6 +454,8 @@ export default {
const classList = document.querySelector('body').classList;
const isPhone = Array.from(classList).includes('phone');
const isTablet = Array.from(classList).includes('tablet');
// address in https://github.com/nasa/openmct/issues/4875
// eslint-disable-next-line compat/compat
const isPortrait = window.screen.orientation.type.includes('portrait');
const isInLayout = Boolean(this.$el.closest('.c-so-view'));
const sidebarCoversEntries = (isPhone || (isTablet && isPortrait) || isInLayout);