Skip to content

Commit

Permalink
chore: move to cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
DIY0R committed Sep 24, 2024
1 parent d80876a commit 898a32a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 33 deletions.
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
Expand Down
14 changes: 7 additions & 7 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import pluginJs from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import prettierPlugin from 'eslint-plugin-prettier';
import eslintConfigPrettier from 'eslint-config-prettier';
const pluginJs = require('@eslint/js');
const globals = require('globals');
const tseslint = require('typescript-eslint');
const prettierPlugin = require('eslint-plugin-prettier');
const eslintConfigPrettier = require('eslint-config-prettier');

/** @type {import('eslint').Linter.FlatConfig[]} */
export default tseslint.config(
module.exports = tseslint.config(
{
plugins: {
'@typescript-eslint': tseslint.plugin,
Expand All @@ -31,7 +31,7 @@ export default tseslint.config(
...globals.es2020,
},
parserOptions: {
project: ['tsconfig.json', 'tsconfig.build.json'],
project: 'tsconfig.json',
},
},
},
Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
"name": "file-graph",
"version": "0.12.1",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"./dist"
],
"type": "module",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"build": "tsc -p tsconfig.cjs.json",
"prettier": "prettier 'lib/**/**.{js,ts}' 'test/**/**.{js,ts}' --check --ignore-unknown",
"prettier:fix": "prettier lib/**/**.{js,ts}' 'test/**/**.{js,ts}' -w",
"lint": "eslint",
Expand Down Expand Up @@ -59,6 +54,7 @@
"data-structure",
"network-analysis"
],
"files": ["dist"],
"npm": {
"publish": true
},
Expand Down
12 changes: 0 additions & 12 deletions tsconfig.build.json

This file was deleted.

11 changes: 11 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "./dist",
"target": "ES2015"
},
"exclude": [
"test/**/*"
]
}
11 changes: 4 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
{
"compilerOptions": {
"module": "ESNext",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"target": "ES2021",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"moduleResolution": "Node",
"baseUrl": ".",
"moduleResolution": "node",
"skipLibCheck": true,
"strictNullChecks": false,
"noImplicitAny": false,
Expand All @@ -20,13 +17,13 @@
},
"include": [
"lib/**/*",
"test/**/*",
"test/**/*"
],
"ignorePatterns": [
"commitlint.config.js"
],
"exclude": [
"node_modules",
"dist",
"dist"
]
}

0 comments on commit 898a32a

Please sign in to comment.