Fix Unexpected Keyword in MediaManager and Add Build Linting
- Fix corrupted line in src/MediaManager.html causing syntax error. - Add ESLint integration to build process to prevent future syntax errors. - Create .eslintrc.js with TypeScript and HTML support. - Relax strict lint rules to accommodate existing codebase.
This commit is contained in:
57
.eslintrc.js
Normal file
57
.eslintrc.js
Normal file
@ -0,0 +1,57 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
es2021: true,
|
||||
node: true,
|
||||
},
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
],
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
},
|
||||
plugins: [
|
||||
"@typescript-eslint",
|
||||
"html",
|
||||
],
|
||||
globals: {
|
||||
"google": "readonly",
|
||||
"Logger": "readonly",
|
||||
"item": "writable",
|
||||
"Utilities": "readonly",
|
||||
"state": "writable",
|
||||
"ui": "writable",
|
||||
"controller": "writable",
|
||||
"gapi": "readonly",
|
||||
},
|
||||
rules: {
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off", // Too noisy for existing codebase
|
||||
"no-unused-vars": "off",
|
||||
"prefer-const": "off",
|
||||
"no-var": "off",
|
||||
"no-undef": "off",
|
||||
"no-redeclare": "off",
|
||||
"no-empty": "warn",
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"no-useless-escape": "off",
|
||||
"no-extra-semi": "off",
|
||||
"no-array-constructor": "off",
|
||||
"@typescript-eslint/no-array-constructor": "off",
|
||||
"@typescript-eslint/no-this-alias": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"no-prototype-builtins": "off"
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ["*.html"],
|
||||
parser: "espree", // Use default parser for HTML scripts if TS parser fails, or just rely on plugin handling
|
||||
// Actually plugin-html handles it. But we usually need to specify not to use TS rules that require type info if we don't have full project info for snippets.
|
||||
}
|
||||
]
|
||||
};
|
||||
Reference in New Issue
Block a user