Skip to content

Commit a9f9ef5

Browse files
committed
fix sample_eslint.config.mjs
1 parent 5bd993f commit a9f9ef5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sample_config/sample_eslint.config.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Import necessary modules for flat config
22
import tsParser from "@typescript-eslint/parser";
3+
import tseslint from "typescript-eslint";
34
// Import the local plugin using ES Module syntax
45
import localPlugin from "../index.js"; // Assumes index.js is the entry point
56
import { dirname } from "node:path";
67
import { fileURLToPath } from "node:url";
78

89
// Sample configuration file for the rule
9-
// ! This configuration file is provided as example and needs to be modified before use.
10+
// ! This configuration file is provided as example and path needs to be modified before use (check path in the code below).
1011
// Usage:
1112
// npx eslint --config "$CONFIG_FILE" "${TARGET_DIR}/**/*.ts"
1213

@@ -47,10 +48,11 @@ export default [
4748
// Define the plugin using the imported object
4849
plugins: {
4950
[pluginName]: localPlugin,
51+
"@typescript-eslint": tseslint.plugin,
5052
},
5153
// Apply the dynamically generated rules
5254
rules: {
53-
allPluginRules,
55+
...allPluginRules, // Spread the plugin rules object
5456
"no-implicit-globals": ["warn"],
5557
curly: ["error", "all"], // All statements with a sub-block must use curly braces, in particular one-liner if-statements. Code without braces is error prone, in particular when a second statement needs to be added.
5658
"@typescript-eslint/no-restricted-types": [

0 commit comments

Comments
 (0)