browsertrix/frontend/.eslintrc.js
sua yoo 26636f5386
Refactor API fetch helper into controller (#1415)
### Context

Components currently can't access `LiteElement` utility methods without
being rendered into the light DOM. This is an initial step towards
breaking out parts of `LiteElement` into composable units. (see
https://github.com/webrecorder/browsertrix-cloud/issues/1380)

### Changes

Moves `apiFetch` from `LiteElement` into a reactive controller. New
components should use `APIController` directly instead of extending
`LiteElement`. We'll also work to move existing uses of `LiteElement`
off of it with time.

### Manual testing

No visible changes, skim through the app to verify that that backend API
fetches work as expected.
2023-11-30 15:00:43 -05:00

48 lines
1.2 KiB
JavaScript

/** @type {import('eslint').Linter.Config} */
module.exports = {
parser: "@typescript-eslint/parser",
env: {
browser: true,
commonjs: true,
es2017: true,
},
extends: [
"plugin:wc/recommended",
"plugin:lit/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
plugins: ["@typescript-eslint", "lit"],
parserOptions: {
project: ["./tsconfig.eslint.json"],
tsconfigRootDir: __dirname,
},
root: true,
rules: {
"no-restricted-globals": [2, "event", "error"],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
},
],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/no-explicit-any": "warn",
},
reportUnusedDisableDirectives: true,
ignorePatterns: ["__generated__", "__mocks__"],
overrides: [
{
extends: ["plugin:@typescript-eslint/disable-type-checked"],
files: ["webpack.*.js"],
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
],
};