-
|
Hello, I'm attempting to import a configuration file made in civet So far these two attempts have failed: // eslint.config.mjs attempt #1
import "@danielx/civet/register"
import config from "./eslint.config.civet"
export default configand // eslint.config.mjs attempt #2
import { register } from 'node:module';
import { pathToFileURL } from 'node:url';
// Register the Civet ESM loader so Node can understand .civet files
register('@danielx/civet/esm', pathToFileURL('./'));
// Import and export your actual configuration
import config from './eslint.config.civet';
export default config;with the following config file Both attempts send: Strangely, using an import in NODE_OPTIONS seems to work with the exact same files: Am I missing something when using importing the register in env: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
Unfortunately, Node in ESM node resolves and links the full static import graph before it runs the module body, so you can't load the Civet loader before the sibling import of
This is why |
Beta Was this translation helpful? Give feedback.
-
|
New solution for eslint specifically: eslint-plugin-civet@0.1.0 (via #1869) provides a |
Beta Was this translation helpful? Give feedback.
Sorry, I parenthesized wrong. It should be