Skip to content

Commit 3ce257c

Browse files
committed
chore!: migrate CJS to ESM
1 parent aace954 commit 3ce257c

11 files changed

Lines changed: 14 additions & 14 deletions

File tree

packages/codegen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@css-modules-kit/codegen",
33
"description": "A tool for generating `*.d.ts` files for `*.module.css`.",
44
"version": "0.7.0",
5-
"type": "commonjs",
5+
"type": "module",
66
"sideEffects": false,
77
"repository": {
88
"type": "git",

packages/codegen/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { parseArgs } from 'node:util';
22
import { resolve } from '@css-modules-kit/core';
3-
import packageJson from '../package.json';
3+
import packageJson from '../package.json' with { type: 'json' };
44
import { ParseCLIArgsError } from './error.js';
55

66
const helpText = `

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@css-modules-kit/core",
33
"description": "The core of css-modules-kit",
44
"version": "0.7.0",
5-
"type": "commonjs",
5+
"type": "module",
66
"sideEffects": false,
77
"repository": {
88
"type": "git",

packages/eslint-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@css-modules-kit/eslint-plugin",
33
"description": "A eslint plugin for CSS Modules",
44
"version": "0.3.1",
5-
"type": "commonjs",
5+
"type": "module",
66
"sideEffects": false,
77
"repository": {
88
"type": "git",

packages/eslint-plugin/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ESLint } from 'eslint';
2-
import packageJson from '../package.json';
2+
import packageJson from '../package.json' with { type: 'json' };
33
import { noMissingComponentFile } from './rules/no-missing-component-file.js';
44
import { noUnusedClassNames } from './rules/no-unused-class-names.js';
55

@@ -60,4 +60,4 @@ const plugin = {
6060
} satisfies ESLint.Plugin;
6161
plugin.configs.recommended.plugins['css-modules-kit'] = plugin;
6262

63-
export = plugin;
63+
export default plugin;

packages/stylelint-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@css-modules-kit/stylelint-plugin",
33
"description": "A stylelint plugin for CSS Modules",
44
"version": "0.4.1",
5-
"type": "commonjs",
5+
"type": "module",
66
"sideEffects": false,
77
"repository": {
88
"type": "git",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { noMissingComponentFile } from './rules/no-missing-component-file.js';
22
import { noUnusedClassNames } from './rules/no-unused-class-names.js';
33

4-
export = [noUnusedClassNames, noMissingComponentFile];
4+
export default [noUnusedClassNames, noMissingComponentFile];

packages/stylelint-plugin/src/recommended.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ const recommendedConfig: Config = {
4242
},
4343
};
4444

45-
export = recommendedConfig;
45+
export default recommendedConfig;

packages/ts-plugin/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@css-modules-kit/ts-plugin",
33
"description": "A TypeScript Language Service Plugin for CSS Modules",
44
"version": "0.7.0",
5-
"type": "commonjs",
5+
"type": "module",
66
"sideEffects": false,
77
"repository": {
88
"type": "git",
@@ -12,7 +12,7 @@
1212
"author": "mizdra <pp.mizdra@gmail.com>",
1313
"license": "MIT",
1414
"private": false,
15-
"main": "./dist/index.js",
15+
"main": "./dist/index.cjs",
1616
"scripts": {
1717
"build": "tsc -b tsconfig.build.json"
1818
},
@@ -25,8 +25,8 @@
2525
},
2626
"exports": {
2727
".": {
28-
"types": "./dist/index.d.ts",
29-
"default": "./dist/index.js"
28+
"types": "./dist/index.d.cts",
29+
"default": "./dist/index.cjs"
3030
},
3131
"./type": {
3232
"types": "./dist/type.d.ts",

0 commit comments

Comments
 (0)