[eslint] Enable no new LitElements
Enable this rule as it was disabled unintentionally.
We want to enforce this for all components eventually.
Bug: none
Change-Id: Iba7e489a6a99fa49ed28f3e3f0a869ff4447a433
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6708462
Commit-Queue: Nikolay Vitkov <[email protected]>
Reviewed-by: Danil Somsikov <[email protected]>
Auto-Submit: Nikolay Vitkov <[email protected]>
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 1d08ba8..73f6280 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -3,13 +3,13 @@
// found in the LICENSE file.
import stylisticPlugin from '@stylistic/eslint-plugin';
+import { defineConfig, globalIgnores } from 'eslint/config';
import eslintPlugin from 'eslint-plugin-eslint-plugin';
import importPlugin from 'eslint-plugin-import';
import jsdocPlugin from 'eslint-plugin-jsdoc';
import mochaPlugin from 'eslint-plugin-mocha';
-import {defineConfig, globalIgnores} from 'eslint/config';
import globals from 'globals';
-import {join} from 'path';
+import { join } from 'path';
import typescriptEslint from 'typescript-eslint';
import rulesdirPlugin from './scripts/eslint_rules/rules-dir.mjs';
@@ -193,7 +193,7 @@
radix: 'error',
'valid-typeof': 'error',
'no-return-assign': ['error', 'always'],
- 'no-implicit-coercion': ['error', {allow: ['!!']}],
+ 'no-implicit-coercion': ['error', { allow: ['!!'] }],
'no-array-constructor': 'error',
@@ -305,11 +305,11 @@
parserOptions: {
allowAutomaticSingleRunInference: true,
project: join(
- import.meta.dirname,
- 'config',
- 'typescript',
- 'tsconfig.eslint.json',
- ),
+ import.meta.dirname,
+ 'config',
+ 'typescript',
+ 'tsconfig.eslint.json',
+ ),
},
},
@@ -554,12 +554,12 @@
{
// Enforce that any import of models/trace/trace.js names the import Trace.
modulePath: join(
- import.meta.dirname,
- 'front_end',
- 'models',
- 'trace',
- 'trace.js',
- ),
+ import.meta.dirname,
+ 'front_end',
+ 'models',
+ 'trace',
+ 'trace.js',
+ ),
importName: 'Trace',
},
],
@@ -635,6 +635,7 @@
},
],
'rulesdir/enforce-ui-strings-as-const': 'error',
+ 'rulesdir/no-new-lit-element-components': 'error',
},
},
{
@@ -779,7 +780,7 @@
},
},
{
- name: 'Front end component docs',
+ name: 'Front-end component docs',
files: ['front_end/ui/components/docs/**/*.ts'],
rules: {
// This makes the component doc examples very verbose and doesn't add
@@ -804,12 +805,12 @@
bannedImportPaths: [
{
bannedPath: join(
- import.meta.dirname,
- 'front_end',
- 'core',
- 'sdk',
- 'sdk.js',
- ),
+ import.meta.dirname,
+ 'front_end',
+ 'core',
+ 'sdk',
+ 'sdk.js',
+ ),
allowTypeImports: true,
},
],