openmct/.eslintrc.cjs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

189 lines
6.0 KiB
JavaScript
Raw Normal View History

const LEGACY_FILES = ['example/**'];
fix(#7623): Resize ConductorAxis properly (#7624) * fix: resize conductor properly * refactor: more computed properties, unregister listener * fix: beforeUnmounted hook * test(visual): add time conductor visual test for fixed mode * fix: initialize to `null` * feat: extend the base `screenshot` function to mask elements which will always create variance in an Open MCT screenshot * docs: add types for fixtures * fix: remove unneeded await * chore: add sinon timers types package back * docs: remove unused docs * doc: remove unused docs * test: add visual realtime url, update imports * feat: provide wrapped page.screenshot fixture that applies defaults * test: add basic timeConductor snapshot tests * chore: update eslint config * lint: remove unused disable directives * test: remove redundant navigation * fix: remove listeners * fix: maybe stabilize unit tests * docs: remove * fix: provide sourcemaps in unit tests * test: add regression snapshot test for time conductor axis * lint: remove unused imports * feat(e2e): add fixture to manually tick the clock and use it * test: reactivate test now that we don't use deploysentinel :( * test: update snapshots * test: add test for clockOptions and tick fixtures * test: add afterEach stub and fixme * test: try and stabilize fault management flake * lint: defy the word gods * chore: ignore `*-darwin.png` screenshots * chore: remove darwin screenshot binaries * docs: markdownlint * docs: remove MacOS specific instructions from snapshot testing * fix: remove a11y
2024-03-26 23:52:33 +00:00
/** @type {import('eslint').Linter.Config} */
const config = {
env: {
browser: true,
fix(#7623): Resize ConductorAxis properly (#7624) * fix: resize conductor properly * refactor: more computed properties, unregister listener * fix: beforeUnmounted hook * test(visual): add time conductor visual test for fixed mode * fix: initialize to `null` * feat: extend the base `screenshot` function to mask elements which will always create variance in an Open MCT screenshot * docs: add types for fixtures * fix: remove unneeded await * chore: add sinon timers types package back * docs: remove unused docs * doc: remove unused docs * test: add visual realtime url, update imports * feat: provide wrapped page.screenshot fixture that applies defaults * test: add basic timeConductor snapshot tests * chore: update eslint config * lint: remove unused disable directives * test: remove redundant navigation * fix: remove listeners * fix: maybe stabilize unit tests * docs: remove * fix: provide sourcemaps in unit tests * test: add regression snapshot test for time conductor axis * lint: remove unused imports * feat(e2e): add fixture to manually tick the clock and use it * test: reactivate test now that we don't use deploysentinel :( * test: update snapshots * test: add test for clockOptions and tick fixtures * test: add afterEach stub and fixme * test: try and stabilize fault management flake * lint: defy the word gods * chore: ignore `*-darwin.png` screenshots * chore: remove darwin screenshot binaries * docs: markdownlint * docs: remove MacOS specific instructions from snapshot testing * fix: remove a11y
2024-03-26 23:52:33 +00:00
es2024: true,
jasmine: true,
fix(#7623): Resize ConductorAxis properly (#7624) * fix: resize conductor properly * refactor: more computed properties, unregister listener * fix: beforeUnmounted hook * test(visual): add time conductor visual test for fixed mode * fix: initialize to `null` * feat: extend the base `screenshot` function to mask elements which will always create variance in an Open MCT screenshot * docs: add types for fixtures * fix: remove unneeded await * chore: add sinon timers types package back * docs: remove unused docs * doc: remove unused docs * test: add visual realtime url, update imports * feat: provide wrapped page.screenshot fixture that applies defaults * test: add basic timeConductor snapshot tests * chore: update eslint config * lint: remove unused disable directives * test: remove redundant navigation * fix: remove listeners * fix: maybe stabilize unit tests * docs: remove * fix: provide sourcemaps in unit tests * test: add regression snapshot test for time conductor axis * lint: remove unused imports * feat(e2e): add fixture to manually tick the clock and use it * test: reactivate test now that we don't use deploysentinel :( * test: update snapshots * test: add test for clockOptions and tick fixtures * test: add afterEach stub and fixme * test: try and stabilize fault management flake * lint: defy the word gods * chore: ignore `*-darwin.png` screenshots * chore: remove darwin screenshot binaries * docs: markdownlint * docs: remove MacOS specific instructions from snapshot testing * fix: remove a11y
2024-03-26 23:52:33 +00:00
node: true,
worker: true,
serviceworker: true
},
globals: {
_: 'readonly'
},
plugins: ['prettier', 'unicorn', 'simple-import-sort'],
extends: [
'eslint:recommended',
'plugin:compat/recommended',
'plugin:vue/vue3-recommended',
chore: add `prettier` (1/3): add packages, configurations, fix lint issues (#6382) * fix: remove redundant eslint rules * chore: bump `prettier` to v2.8.7 * docs: vue files to use html comments for licenses - Prettier's Vue parser freaks out if it sees a *.js style comment in a *.vue file. * docs: more licenses for vue files * fix: don't ignore *.vue files * fix: use defaults for tabWidth and printWidth * simplify .prettierignore * enforce a printWidth of 100 * fix: use `eslint-plugin-prettier`, remove conflicting rules * test: fix gauge tests (for real) * test: fix notebook test selectors * test: fix restrictedNotebook test selectors * test: remove useless assignment * lint: __dirname as global * lint: revert eslint config + whitespace changes, commit new config * style: remove unnecessary string concat of literals * test: fix missed gauge test * fix: use new eslint rules * feat: add blank `.git-blame-ignore-revs` file * docs: update to mention Prettier and format. * Revert "test: fix gauge tests (for real)" This reverts commit 6afad450389edc2f16ff0d00c9524621a7ba53bc. * Revert "test: fix notebook test selectors" This reverts commit 17fe1cbbff02e9298f041b5ea0fea5494fe54d94. * Revert "test: fix restrictedNotebook test selectors" This reverts commit 97e0ede826b7dd61c5443845443d806a56f3f305. * Revert "test: fix missed gauge test" This reverts commit e2398fc38ca94beff2066cc253173412ad47f8b9. * test: fix gauge tests (no formatting) * test: update notebook e2e selectors (no formatting) * test: update restrictedNotebook e2e selectors (no formatting) * fix: temporarily disable lint check
2023-05-18 21:29:20 +00:00
'plugin:you-dont-need-lodash-underscore/compatible',
'plugin:prettier/recommended',
'plugin:no-unsanitized/DOM'
],
parser: 'vue-eslint-parser',
parserOptions: {
chore: add `prettier` (1/3): add packages, configurations, fix lint issues (#6382) * fix: remove redundant eslint rules * chore: bump `prettier` to v2.8.7 * docs: vue files to use html comments for licenses - Prettier's Vue parser freaks out if it sees a *.js style comment in a *.vue file. * docs: more licenses for vue files * fix: don't ignore *.vue files * fix: use defaults for tabWidth and printWidth * simplify .prettierignore * enforce a printWidth of 100 * fix: use `eslint-plugin-prettier`, remove conflicting rules * test: fix gauge tests (for real) * test: fix notebook test selectors * test: fix restrictedNotebook test selectors * test: remove useless assignment * lint: __dirname as global * lint: revert eslint config + whitespace changes, commit new config * style: remove unnecessary string concat of literals * test: fix missed gauge test * fix: use new eslint rules * feat: add blank `.git-blame-ignore-revs` file * docs: update to mention Prettier and format. * Revert "test: fix gauge tests (for real)" This reverts commit 6afad450389edc2f16ff0d00c9524621a7ba53bc. * Revert "test: fix notebook test selectors" This reverts commit 17fe1cbbff02e9298f041b5ea0fea5494fe54d94. * Revert "test: fix restrictedNotebook test selectors" This reverts commit 97e0ede826b7dd61c5443845443d806a56f3f305. * Revert "test: fix missed gauge test" This reverts commit e2398fc38ca94beff2066cc253173412ad47f8b9. * test: fix gauge tests (no formatting) * test: update notebook e2e selectors (no formatting) * test: update restrictedNotebook e2e selectors (no formatting) * fix: temporarily disable lint check
2023-05-18 21:29:20 +00:00
parser: '@babel/eslint-parser',
requireConfigFile: false,
allowImportExportEverywhere: true,
fix(#7623): Resize ConductorAxis properly (#7624) * fix: resize conductor properly * refactor: more computed properties, unregister listener * fix: beforeUnmounted hook * test(visual): add time conductor visual test for fixed mode * fix: initialize to `null` * feat: extend the base `screenshot` function to mask elements which will always create variance in an Open MCT screenshot * docs: add types for fixtures * fix: remove unneeded await * chore: add sinon timers types package back * docs: remove unused docs * doc: remove unused docs * test: add visual realtime url, update imports * feat: provide wrapped page.screenshot fixture that applies defaults * test: add basic timeConductor snapshot tests * chore: update eslint config * lint: remove unused disable directives * test: remove redundant navigation * fix: remove listeners * fix: maybe stabilize unit tests * docs: remove * fix: provide sourcemaps in unit tests * test: add regression snapshot test for time conductor axis * lint: remove unused imports * feat(e2e): add fixture to manually tick the clock and use it * test: reactivate test now that we don't use deploysentinel :( * test: update snapshots * test: add test for clockOptions and tick fixtures * test: add afterEach stub and fixme * test: try and stabilize fault management flake * lint: defy the word gods * chore: ignore `*-darwin.png` screenshots * chore: remove darwin screenshot binaries * docs: markdownlint * docs: remove MacOS specific instructions from snapshot testing * fix: remove a11y
2024-03-26 23:52:33 +00:00
ecmaVersion: 'latest',
ecmaFeatures: {
chore: add `prettier` (1/3): add packages, configurations, fix lint issues (#6382) * fix: remove redundant eslint rules * chore: bump `prettier` to v2.8.7 * docs: vue files to use html comments for licenses - Prettier's Vue parser freaks out if it sees a *.js style comment in a *.vue file. * docs: more licenses for vue files * fix: don't ignore *.vue files * fix: use defaults for tabWidth and printWidth * simplify .prettierignore * enforce a printWidth of 100 * fix: use `eslint-plugin-prettier`, remove conflicting rules * test: fix gauge tests (for real) * test: fix notebook test selectors * test: fix restrictedNotebook test selectors * test: remove useless assignment * lint: __dirname as global * lint: revert eslint config + whitespace changes, commit new config * style: remove unnecessary string concat of literals * test: fix missed gauge test * fix: use new eslint rules * feat: add blank `.git-blame-ignore-revs` file * docs: update to mention Prettier and format. * Revert "test: fix gauge tests (for real)" This reverts commit 6afad450389edc2f16ff0d00c9524621a7ba53bc. * Revert "test: fix notebook test selectors" This reverts commit 17fe1cbbff02e9298f041b5ea0fea5494fe54d94. * Revert "test: fix restrictedNotebook test selectors" This reverts commit 97e0ede826b7dd61c5443845443d806a56f3f305. * Revert "test: fix missed gauge test" This reverts commit e2398fc38ca94beff2066cc253173412ad47f8b9. * test: fix gauge tests (no formatting) * test: update notebook e2e selectors (no formatting) * test: update restrictedNotebook e2e selectors (no formatting) * fix: temporarily disable lint check
2023-05-18 21:29:20 +00:00
impliedStrict: true
fix(#7623): Resize ConductorAxis properly (#7624) * fix: resize conductor properly * refactor: more computed properties, unregister listener * fix: beforeUnmounted hook * test(visual): add time conductor visual test for fixed mode * fix: initialize to `null` * feat: extend the base `screenshot` function to mask elements which will always create variance in an Open MCT screenshot * docs: add types for fixtures * fix: remove unneeded await * chore: add sinon timers types package back * docs: remove unused docs * doc: remove unused docs * test: add visual realtime url, update imports * feat: provide wrapped page.screenshot fixture that applies defaults * test: add basic timeConductor snapshot tests * chore: update eslint config * lint: remove unused disable directives * test: remove redundant navigation * fix: remove listeners * fix: maybe stabilize unit tests * docs: remove * fix: provide sourcemaps in unit tests * test: add regression snapshot test for time conductor axis * lint: remove unused imports * feat(e2e): add fixture to manually tick the clock and use it * test: reactivate test now that we don't use deploysentinel :( * test: update snapshots * test: add test for clockOptions and tick fixtures * test: add afterEach stub and fixme * test: try and stabilize fault management flake * lint: defy the word gods * chore: ignore `*-darwin.png` screenshots * chore: remove darwin screenshot binaries * docs: markdownlint * docs: remove MacOS specific instructions from snapshot testing * fix: remove a11y
2024-03-26 23:52:33 +00:00
},
sourceType: 'module'
},
rules: {
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
'vue/no-deprecated-dollar-listeners-api': 'warn',
'vue/no-deprecated-events-api': 'warn',
'vue/no-v-for-template-key': 'off',
'vue/no-v-for-template-key-on-child': 'error',
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
chore: add `prettier` (1/3): add packages, configurations, fix lint issues (#6382) * fix: remove redundant eslint rules * chore: bump `prettier` to v2.8.7 * docs: vue files to use html comments for licenses - Prettier's Vue parser freaks out if it sees a *.js style comment in a *.vue file. * docs: more licenses for vue files * fix: don't ignore *.vue files * fix: use defaults for tabWidth and printWidth * simplify .prettierignore * enforce a printWidth of 100 * fix: use `eslint-plugin-prettier`, remove conflicting rules * test: fix gauge tests (for real) * test: fix notebook test selectors * test: fix restrictedNotebook test selectors * test: remove useless assignment * lint: __dirname as global * lint: revert eslint config + whitespace changes, commit new config * style: remove unnecessary string concat of literals * test: fix missed gauge test * fix: use new eslint rules * feat: add blank `.git-blame-ignore-revs` file * docs: update to mention Prettier and format. * Revert "test: fix gauge tests (for real)" This reverts commit 6afad450389edc2f16ff0d00c9524621a7ba53bc. * Revert "test: fix notebook test selectors" This reverts commit 17fe1cbbff02e9298f041b5ea0fea5494fe54d94. * Revert "test: fix restrictedNotebook test selectors" This reverts commit 97e0ede826b7dd61c5443845443d806a56f3f305. * Revert "test: fix missed gauge test" This reverts commit e2398fc38ca94beff2066cc253173412ad47f8b9. * test: fix gauge tests (no formatting) * test: update notebook e2e selectors (no formatting) * test: update restrictedNotebook e2e selectors (no formatting) * fix: temporarily disable lint check
2023-05-18 21:29:20 +00:00
'prettier/prettier': 'error',
'you-dont-need-lodash-underscore/omit': 'off',
'you-dont-need-lodash-underscore/throttle': 'off',
'you-dont-need-lodash-underscore/flatten': 'off',
'you-dont-need-lodash-underscore/get': 'off',
'no-bitwise': 'error',
curly: 'error',
eqeqeq: 'error',
'guard-for-in': 'error',
chore: add `prettier` (1/3): add packages, configurations, fix lint issues (#6382) * fix: remove redundant eslint rules * chore: bump `prettier` to v2.8.7 * docs: vue files to use html comments for licenses - Prettier's Vue parser freaks out if it sees a *.js style comment in a *.vue file. * docs: more licenses for vue files * fix: don't ignore *.vue files * fix: use defaults for tabWidth and printWidth * simplify .prettierignore * enforce a printWidth of 100 * fix: use `eslint-plugin-prettier`, remove conflicting rules * test: fix gauge tests (for real) * test: fix notebook test selectors * test: fix restrictedNotebook test selectors * test: remove useless assignment * lint: __dirname as global * lint: revert eslint config + whitespace changes, commit new config * style: remove unnecessary string concat of literals * test: fix missed gauge test * fix: use new eslint rules * feat: add blank `.git-blame-ignore-revs` file * docs: update to mention Prettier and format. * Revert "test: fix gauge tests (for real)" This reverts commit 6afad450389edc2f16ff0d00c9524621a7ba53bc. * Revert "test: fix notebook test selectors" This reverts commit 17fe1cbbff02e9298f041b5ea0fea5494fe54d94. * Revert "test: fix restrictedNotebook test selectors" This reverts commit 97e0ede826b7dd61c5443845443d806a56f3f305. * Revert "test: fix missed gauge test" This reverts commit e2398fc38ca94beff2066cc253173412ad47f8b9. * test: fix gauge tests (no formatting) * test: update notebook e2e selectors (no formatting) * test: update restrictedNotebook e2e selectors (no formatting) * fix: temporarily disable lint check
2023-05-18 21:29:20 +00:00
'no-extend-native': 'error',
'no-inner-declarations': 'off',
'no-use-before-define': ['error', 'nofunc'],
'no-caller': 'error',
'no-irregular-whitespace': 'error',
'no-new': 'error',
'no-shadow': 'error',
'no-undef': 'error',
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'none'
}
],
'no-console': 'off',
'new-cap': [
'error',
{
capIsNew: false,
properties: false
}
],
'dot-notation': 'error',
// https://eslint.org/docs/rules/no-case-declarations
'no-case-declarations': 'error',
// https://eslint.org/docs/rules/max-classes-per-file
'max-classes-per-file': ['error', 1],
// https://eslint.org/docs/rules/no-eq-null
'no-eq-null': 'error',
// https://eslint.org/docs/rules/no-eval
'no-eval': 'error',
// https://eslint.org/docs/rules/no-implicit-globals
'no-implicit-globals': 'error',
// https://eslint.org/docs/rules/no-implied-eval
'no-implied-eval': 'error',
// https://eslint.org/docs/rules/no-lone-blocks
'no-lone-blocks': 'error',
// https://eslint.org/docs/rules/no-loop-func
'no-loop-func': 'error',
// https://eslint.org/docs/rules/no-new-func
'no-new-func': 'error',
// https://eslint.org/docs/rules/no-new-wrappers
'no-new-wrappers': 'error',
// https://eslint.org/docs/rules/no-octal-escape
'no-octal-escape': 'error',
// https://eslint.org/docs/rules/no-proto
'no-proto': 'error',
// https://eslint.org/docs/rules/no-return-await
'no-return-await': 'error',
// https://eslint.org/docs/rules/no-script-url
'no-script-url': 'error',
// https://eslint.org/docs/rules/no-self-compare
'no-self-compare': 'error',
// https://eslint.org/docs/rules/no-sequences
'no-sequences': 'error',
// https://eslint.org/docs/rules/no-unmodified-loop-condition
'no-unmodified-loop-condition': 'error',
// https://eslint.org/docs/rules/no-useless-call
'no-useless-call': 'error',
// https://eslint.org/docs/rules/no-nested-ternary
'no-nested-ternary': 'error',
// https://eslint.org/docs/rules/no-useless-computed-key
'no-useless-computed-key': 'error',
// https://eslint.org/docs/rules/no-var
'no-var': 'error',
// https://eslint.org/docs/rules/one-var
'one-var': ['error', 'never'],
// https://eslint.org/docs/rules/default-case-last
'default-case-last': 'error',
// https://eslint.org/docs/rules/default-param-last
'default-param-last': 'error',
// https://eslint.org/docs/rules/grouped-accessor-pairs
'grouped-accessor-pairs': 'error',
// https://eslint.org/docs/rules/no-constructor-return
'no-constructor-return': 'error',
// https://eslint.org/docs/rules/array-callback-return
'array-callback-return': 'error',
// https://eslint.org/docs/rules/no-invalid-this
'no-invalid-this': 'error', // Believe this one actually surfaces some bugs
// https://eslint.org/docs/rules/func-style
'func-style': ['error', 'declaration'],
// https://eslint.org/docs/rules/no-unused-expressions
'no-unused-expressions': 'error',
// https://eslint.org/docs/rules/no-useless-concat
'no-useless-concat': 'error',
// https://eslint.org/docs/rules/radix
radix: 'error',
// https://eslint.org/docs/rules/require-await
'require-await': 'error',
// https://eslint.org/docs/rules/no-alert
'no-alert': 'error',
// https://eslint.org/docs/rules/no-useless-constructor
'no-useless-constructor': 'error',
// https://eslint.org/docs/rules/no-duplicate-imports
'no-duplicate-imports': 'error',
// https://eslint.org/docs/rules/no-implicit-coercion
'no-implicit-coercion': 'error',
//https://eslint.org/docs/rules/no-unneeded-ternary
'no-unneeded-ternary': 'error',
'unicorn/filename-case': [
'error',
{
cases: {
pascalCase: true
},
fix(#7623): Resize ConductorAxis properly (#7624) * fix: resize conductor properly * refactor: more computed properties, unregister listener * fix: beforeUnmounted hook * test(visual): add time conductor visual test for fixed mode * fix: initialize to `null` * feat: extend the base `screenshot` function to mask elements which will always create variance in an Open MCT screenshot * docs: add types for fixtures * fix: remove unneeded await * chore: add sinon timers types package back * docs: remove unused docs * doc: remove unused docs * test: add visual realtime url, update imports * feat: provide wrapped page.screenshot fixture that applies defaults * test: add basic timeConductor snapshot tests * chore: update eslint config * lint: remove unused disable directives * test: remove redundant navigation * fix: remove listeners * fix: maybe stabilize unit tests * docs: remove * fix: provide sourcemaps in unit tests * test: add regression snapshot test for time conductor axis * lint: remove unused imports * feat(e2e): add fixture to manually tick the clock and use it * test: reactivate test now that we don't use deploysentinel :( * test: update snapshots * test: add test for clockOptions and tick fixtures * test: add afterEach stub and fixme * test: try and stabilize fault management flake * lint: defy the word gods * chore: ignore `*-darwin.png` screenshots * chore: remove darwin screenshot binaries * docs: markdownlint * docs: remove MacOS specific instructions from snapshot testing * fix: remove a11y
2024-03-26 23:52:33 +00:00
ignore: ['^.*\\.(js|cjs|mjs)$']
}
],
'vue/first-attribute-linebreak': 'error',
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/no-mutating-props': 'off' // TODO: Remove this rule and fix resulting errors
},
overrides: [
{
files: LEGACY_FILES,
rules: {
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'none',
varsIgnorePattern: 'controller'
}
],
'no-nested-ternary': 'off',
'no-var': 'off',
'one-var': 'off'
}
}
]
};
fix(#7623): Resize ConductorAxis properly (#7624) * fix: resize conductor properly * refactor: more computed properties, unregister listener * fix: beforeUnmounted hook * test(visual): add time conductor visual test for fixed mode * fix: initialize to `null` * feat: extend the base `screenshot` function to mask elements which will always create variance in an Open MCT screenshot * docs: add types for fixtures * fix: remove unneeded await * chore: add sinon timers types package back * docs: remove unused docs * doc: remove unused docs * test: add visual realtime url, update imports * feat: provide wrapped page.screenshot fixture that applies defaults * test: add basic timeConductor snapshot tests * chore: update eslint config * lint: remove unused disable directives * test: remove redundant navigation * fix: remove listeners * fix: maybe stabilize unit tests * docs: remove * fix: provide sourcemaps in unit tests * test: add regression snapshot test for time conductor axis * lint: remove unused imports * feat(e2e): add fixture to manually tick the clock and use it * test: reactivate test now that we don't use deploysentinel :( * test: update snapshots * test: add test for clockOptions and tick fixtures * test: add afterEach stub and fixme * test: try and stabilize fault management flake * lint: defy the word gods * chore: ignore `*-darwin.png` screenshots * chore: remove darwin screenshot binaries * docs: markdownlint * docs: remove MacOS specific instructions from snapshot testing * fix: remove a11y
2024-03-26 23:52:33 +00:00
module.exports = config;