feat(SW-3596): added lint rule for no console.log. Use logger instead. * feat(SW-3596): added lint rule for no console.log. Use logger instead. Approved-by: Joakim Jäderberg
43 lines
1.4 KiB
JavaScript
43 lines
1.4 KiB
JavaScript
import { FlatCompat } from "@eslint/eslintrc";
|
|
import js from "@eslint/js";
|
|
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
|
import tsParser from "@typescript-eslint/parser";
|
|
import { defineConfig } from "eslint/config";
|
|
import simpleImportSort from "eslint-plugin-simple-import-sort";
|
|
|
|
const compat = new FlatCompat({
|
|
recommendedConfig: js.configs.recommended,
|
|
allConfig: js.configs.all,
|
|
});
|
|
|
|
export default defineConfig([
|
|
{
|
|
extends: compat.extends("plugin:@typescript-eslint/recommended"),
|
|
plugins: {
|
|
"simple-import-sort": simpleImportSort,
|
|
"@typescript-eslint": typescriptEslint,
|
|
},
|
|
languageOptions: {
|
|
parser: tsParser,
|
|
},
|
|
rules: {
|
|
"no-console": "warn",
|
|
"no-unused-vars": "off",
|
|
"simple-import-sort/imports": "error",
|
|
"simple-import-sort/exports": "error",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{
|
|
args: "all",
|
|
argsIgnorePattern: "^_",
|
|
caughtErrors: "all",
|
|
caughtErrorsIgnorePattern: "^_",
|
|
destructuredArrayIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
ignoreRestSiblings: true,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
]);
|