mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor: move all the config files to root (#8033)
This commit is contained in:
12
.eslintrc.json
Normal file
12
.eslintrc.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"extends": "marine/prettier/node",
|
||||||
|
"parserOptions": {
|
||||||
|
"project": "./tsconfig.eslint.json",
|
||||||
|
"extraFileExtensions": [".mjs"]
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["**/dist/*"],
|
||||||
|
"env": {
|
||||||
|
"jest": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,3 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"extends": "../../.eslintrc.json"
|
||||||
"extends": "marine/prettier/node",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.eslint.json",
|
|
||||||
"extraFileExtensions": [".mjs"]
|
|
||||||
},
|
|
||||||
"ignorePatterns": ["**/dist/*"],
|
|
||||||
"env": {
|
|
||||||
"jest": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
packages/actions/.prettierrc.js
Normal file
1
packages/actions/.prettierrc.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../../.prettierrc.json');
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 120,
|
|
||||||
"useTabs": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"trailingComma": "all",
|
|
||||||
"endOfLine": "lf"
|
|
||||||
}
|
|
||||||
@@ -1,20 +1,3 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "../../tsconfig.eslint.json"
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
"**/*.js",
|
|
||||||
"**/*.mjs",
|
|
||||||
"**/*.jsx",
|
|
||||||
"**/*.test.ts",
|
|
||||||
"**/*.test.js",
|
|
||||||
"**/*.test.mjs",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.spec.js",
|
|
||||||
"**/*.spec.mjs"
|
|
||||||
],
|
|
||||||
"exclude": []
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
import { defineConfig } from 'tsup';
|
import { createTsupConfig } from '../../tsup.config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default createTsupConfig({
|
||||||
clean: true,
|
entry: ['src/index.ts', 'src/formatTag/index.ts'],
|
||||||
dts: true,
|
|
||||||
entryPoints: ['src/index.ts', 'src/formatTag/index.ts'],
|
|
||||||
format: ['cjs'],
|
format: ['cjs'],
|
||||||
minify: true,
|
|
||||||
skipNodeModulesBundle: false,
|
skipNodeModulesBundle: false,
|
||||||
noExternal: ['@actions/core'],
|
noExternal: ['@actions/core'],
|
||||||
sourcemap: true,
|
minify: true,
|
||||||
target: 'es2021',
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,12 +1,3 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"extends": "../../.eslintrc.json"
|
||||||
"extends": "marine/prettier/node",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.eslint.json",
|
|
||||||
"extraFileExtensions": [".mjs"]
|
|
||||||
},
|
|
||||||
"ignorePatterns": ["**/dist/*"],
|
|
||||||
"env": {
|
|
||||||
"jest": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
packages/builders/.prettierrc.js
Normal file
1
packages/builders/.prettierrc.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../../.prettierrc.json');
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 120,
|
|
||||||
"useTabs": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"trailingComma": "all",
|
|
||||||
"endOfLine": "lf"
|
|
||||||
}
|
|
||||||
@@ -1,20 +1,3 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "../../tsconfig.eslint.json"
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
"**/*.js",
|
|
||||||
"**/*.mjs",
|
|
||||||
"**/*.jsx",
|
|
||||||
"**/*.test.ts",
|
|
||||||
"**/*.test.js",
|
|
||||||
"**/*.test.mjs",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.spec.js",
|
|
||||||
"**/*.spec.mjs"
|
|
||||||
],
|
|
||||||
"exclude": []
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,3 @@
|
|||||||
import { defineConfig } from 'tsup';
|
import { createTsupConfig } from '../../tsup.config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default createTsupConfig();
|
||||||
clean: true,
|
|
||||||
dts: true,
|
|
||||||
entryPoints: ['src/index.ts'],
|
|
||||||
format: ['esm', 'cjs'],
|
|
||||||
minify: false,
|
|
||||||
keepNames: true,
|
|
||||||
skipNodeModulesBundle: true,
|
|
||||||
sourcemap: true,
|
|
||||||
target: 'es2021',
|
|
||||||
esbuildOptions: (options, context) => {
|
|
||||||
if (context.format === 'cjs') {
|
|
||||||
options.banner = {
|
|
||||||
js: '"use strict";',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -1,12 +1,3 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"extends": "../../.eslintrc.json"
|
||||||
"extends": "marine/prettier/node",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.eslint.json",
|
|
||||||
"extraFileExtensions": [".mjs"]
|
|
||||||
},
|
|
||||||
"ignorePatterns": ["**/dist/*"],
|
|
||||||
"env": {
|
|
||||||
"jest": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
packages/collection/.prettierrc.js
Normal file
1
packages/collection/.prettierrc.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../../.prettierrc.json');
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 120,
|
|
||||||
"useTabs": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"trailingComma": "all",
|
|
||||||
"endOfLine": "lf"
|
|
||||||
}
|
|
||||||
@@ -1,20 +1,3 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "../../tsconfig.eslint.json"
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
"**/*.js",
|
|
||||||
"**/*.mjs",
|
|
||||||
"**/*.jsx",
|
|
||||||
"**/*.test.ts",
|
|
||||||
"**/*.test.js",
|
|
||||||
"**/*.test.mjs",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.spec.js",
|
|
||||||
"**/*.spec.mjs"
|
|
||||||
],
|
|
||||||
"exclude": []
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,3 @@
|
|||||||
import { defineConfig } from 'tsup';
|
import { createTsupConfig } from '../../tsup.config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default createTsupConfig();
|
||||||
clean: true,
|
|
||||||
dts: true,
|
|
||||||
entryPoints: ['src/index.ts'],
|
|
||||||
format: ['esm', 'cjs'],
|
|
||||||
minify: false,
|
|
||||||
// if false: causes Collection.constructor to be a minified value like: 'o'
|
|
||||||
keepNames: true,
|
|
||||||
skipNodeModulesBundle: true,
|
|
||||||
sourcemap: true,
|
|
||||||
target: 'es2021',
|
|
||||||
esbuildOptions: (options, context) => {
|
|
||||||
if (context.format === 'cjs') {
|
|
||||||
options.banner = {
|
|
||||||
js: '"use strict";',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -19,17 +19,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"prettier/prettier": [
|
|
||||||
2,
|
|
||||||
{
|
|
||||||
"printWidth": 120,
|
|
||||||
"singleQuote": true,
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"trailingComma": "all",
|
|
||||||
"endOfLine": "lf",
|
|
||||||
"arrowParens": "avoid"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"strict": ["error", "global"],
|
"strict": ["error", "global"],
|
||||||
"no-await-in-loop": "warn",
|
"no-await-in-loop": "warn",
|
||||||
"no-compare-neg-zero": "error",
|
"no-compare-neg-zero": "error",
|
||||||
|
|||||||
@@ -1,12 +1,3 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"extends": "../../.eslintrc.json"
|
||||||
"extends": "marine/prettier/node",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.eslint.json",
|
|
||||||
"extraFileExtensions": [".mjs"]
|
|
||||||
},
|
|
||||||
"ignorePatterns": ["**/dist/*"],
|
|
||||||
"env": {
|
|
||||||
"jest": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
packages/docgen/.prettierrc.js
Normal file
1
packages/docgen/.prettierrc.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../../.prettierrc.json');
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 120,
|
|
||||||
"useTabs": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"trailingComma": "all",
|
|
||||||
"endOfLine": "lf"
|
|
||||||
}
|
|
||||||
@@ -1,20 +1,3 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "../../tsconfig.eslint.json"
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
"**/*.js",
|
|
||||||
"**/*.mjs",
|
|
||||||
"**/*.jsx",
|
|
||||||
"**/*.test.ts",
|
|
||||||
"**/*.test.js",
|
|
||||||
"**/*.test.mjs",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.spec.js",
|
|
||||||
"**/*.spec.mjs"
|
|
||||||
],
|
|
||||||
"exclude": []
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
import { defineConfig } from 'tsup';
|
import { createTsupConfig } from '../../tsup.config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default createTsupConfig({
|
||||||
clean: true,
|
minify: true,
|
||||||
dts: true,
|
|
||||||
entryPoints: ['src/index.ts'],
|
|
||||||
format: ['esm', 'cjs'],
|
|
||||||
keepNames: true,
|
|
||||||
minify: false,
|
|
||||||
skipNodeModulesBundle: true,
|
|
||||||
sourcemap: true,
|
|
||||||
target: 'es2021',
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,12 +1,3 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"extends": "../../.eslintrc.json"
|
||||||
"extends": "marine/prettier/node",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.eslint.json",
|
|
||||||
"extraFileExtensions": [".mjs"]
|
|
||||||
},
|
|
||||||
"ignorePatterns": ["**/dist/*"],
|
|
||||||
"env": {
|
|
||||||
"jest": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
packages/proxy/.prettierrc.js
Normal file
1
packages/proxy/.prettierrc.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../../.prettierrc.json');
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 120,
|
|
||||||
"useTabs": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"trailingComma": "all",
|
|
||||||
"endOfLine": "lf"
|
|
||||||
}
|
|
||||||
@@ -1,20 +1,3 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "../../tsconfig.eslint.json"
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
"**/*.js",
|
|
||||||
"**/*.mjs",
|
|
||||||
"**/*.jsx",
|
|
||||||
"**/*.test.ts",
|
|
||||||
"**/*.test.js",
|
|
||||||
"**/*.test.mjs",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.spec.js",
|
|
||||||
"**/*.spec.mjs"
|
|
||||||
],
|
|
||||||
"exclude": []
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,3 @@
|
|||||||
import { defineConfig } from 'tsup';
|
import { createTsupConfig } from '../../tsup.config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default createTsupConfig();
|
||||||
clean: true,
|
|
||||||
dts: true,
|
|
||||||
entryPoints: ['src/index.ts'],
|
|
||||||
format: ['esm', 'cjs'],
|
|
||||||
minify: false,
|
|
||||||
keepNames: true,
|
|
||||||
skipNodeModulesBundle: true,
|
|
||||||
sourcemap: true,
|
|
||||||
target: 'es2021',
|
|
||||||
esbuildOptions: (options, context) => {
|
|
||||||
if (context.format === 'cjs') {
|
|
||||||
options.banner = {
|
|
||||||
js: '"use strict";',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -1,12 +1,3 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"extends": "../../.eslintrc.json"
|
||||||
"extends": "marine/prettier/node",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.eslint.json",
|
|
||||||
"extraFileExtensions": [".mjs"]
|
|
||||||
},
|
|
||||||
"ignorePatterns": ["**/dist/*"],
|
|
||||||
"env": {
|
|
||||||
"jest": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
packages/rest/.prettierrc.js
Normal file
1
packages/rest/.prettierrc.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../../.prettierrc.json');
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 120,
|
|
||||||
"useTabs": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"trailingComma": "all",
|
|
||||||
"endOfLine": "lf"
|
|
||||||
}
|
|
||||||
@@ -1,20 +1,3 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "../../tsconfig.eslint.json"
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
"**/*.js",
|
|
||||||
"**/*.mjs",
|
|
||||||
"**/*.jsx",
|
|
||||||
"**/*.test.ts",
|
|
||||||
"**/*.test.js",
|
|
||||||
"**/*.test.mjs",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.spec.js",
|
|
||||||
"**/*.spec.mjs"
|
|
||||||
],
|
|
||||||
"exclude": []
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,3 @@
|
|||||||
import { defineConfig } from 'tsup';
|
import { createTsupConfig } from '../../tsup.config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default createTsupConfig();
|
||||||
clean: true,
|
|
||||||
dts: false,
|
|
||||||
entryPoints: ['src/index.ts'],
|
|
||||||
format: ['esm', 'cjs'],
|
|
||||||
minify: false,
|
|
||||||
keepNames: true,
|
|
||||||
skipNodeModulesBundle: true,
|
|
||||||
sourcemap: true,
|
|
||||||
target: 'es2021',
|
|
||||||
esbuildOptions: (options, context) => {
|
|
||||||
if (context.format === 'cjs') {
|
|
||||||
options.banner = {
|
|
||||||
js: '"use strict";',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -1,12 +1,3 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"extends": "../../.eslintrc.json"
|
||||||
"extends": "marine/prettier/node",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.eslint.json",
|
|
||||||
"extraFileExtensions": [".mjs"]
|
|
||||||
},
|
|
||||||
"ignorePatterns": ["**/dist/*"],
|
|
||||||
"env": {
|
|
||||||
"jest": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
packages/scripts/.prettierrc.js
Normal file
1
packages/scripts/.prettierrc.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../../.prettierrc.json');
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 120,
|
|
||||||
"useTabs": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"trailingComma": "all",
|
|
||||||
"endOfLine": "lf"
|
|
||||||
}
|
|
||||||
@@ -1,20 +1,3 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "../../tsconfig.eslint.json"
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
"**/*.js",
|
|
||||||
"**/*.mjs",
|
|
||||||
"**/*.jsx",
|
|
||||||
"**/*.test.ts",
|
|
||||||
"**/*.test.js",
|
|
||||||
"**/*.test.mjs",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.spec.js",
|
|
||||||
"**/*.spec.mjs"
|
|
||||||
],
|
|
||||||
"exclude": []
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
import { defineConfig } from 'tsup';
|
import { createTsupConfig } from '../../tsup.config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default createTsupConfig({
|
||||||
clean: true,
|
entry: ['src/docs.ts'],
|
||||||
dts: true,
|
|
||||||
entryPoints: ['src/docs.ts'],
|
|
||||||
format: ['esm', 'cjs'],
|
|
||||||
minify: true,
|
minify: true,
|
||||||
skipNodeModulesBundle: true,
|
|
||||||
sourcemap: true,
|
|
||||||
target: 'es2021',
|
|
||||||
});
|
});
|
||||||
|
|||||||
1
packages/voice/.prettierrc.js
Normal file
1
packages/voice/.prettierrc.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../../.prettierrc.json');
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 120,
|
|
||||||
"useTabs": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"trailingComma": "all",
|
|
||||||
"endOfLine": "lf"
|
|
||||||
}
|
|
||||||
@@ -1,20 +1,3 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "../../tsconfig.eslint.json"
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
"**/*.js",
|
|
||||||
"**/*.mjs",
|
|
||||||
"**/*.jsx",
|
|
||||||
"**/*.test.ts",
|
|
||||||
"**/*.test.js",
|
|
||||||
"**/*.test.mjs",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.spec.js",
|
|
||||||
"**/*.spec.mjs"
|
|
||||||
],
|
|
||||||
"exclude": []
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,3 @@
|
|||||||
import { defineConfig } from 'tsup';
|
import { createTsupConfig } from '../../tsup.config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default createTsupConfig();
|
||||||
clean: true,
|
|
||||||
dts: true,
|
|
||||||
entryPoints: ['src/index.ts'],
|
|
||||||
format: ['esm', 'cjs'],
|
|
||||||
minify: false,
|
|
||||||
keepNames: true,
|
|
||||||
skipNodeModulesBundle: true,
|
|
||||||
sourcemap: true,
|
|
||||||
target: 'es2021',
|
|
||||||
esbuildOptions: (options, context) => {
|
|
||||||
if (context.format === 'cjs') {
|
|
||||||
options.banner = {
|
|
||||||
js: '"use strict";',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|||||||
20
tsconfig.eslint.json
Normal file
20
tsconfig.eslint.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowJs": true
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"**/*.ts",
|
||||||
|
"**/*.tsx",
|
||||||
|
"**/*.js",
|
||||||
|
"**/*.mjs",
|
||||||
|
"**/*.jsx",
|
||||||
|
"**/*.test.ts",
|
||||||
|
"**/*.test.js",
|
||||||
|
"**/*.test.mjs",
|
||||||
|
"**/*.spec.ts",
|
||||||
|
"**/*.spec.js",
|
||||||
|
"**/*.spec.mjs"
|
||||||
|
],
|
||||||
|
"exclude": []
|
||||||
|
}
|
||||||
48
tsup.config.ts
Normal file
48
tsup.config.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { relative, resolve } from 'node:path';
|
||||||
|
import { defineConfig, type Options } from 'tsup';
|
||||||
|
|
||||||
|
type ConfigOptions = Pick<
|
||||||
|
Options,
|
||||||
|
| 'globalName'
|
||||||
|
| 'minify'
|
||||||
|
| 'entry'
|
||||||
|
| 'format'
|
||||||
|
| 'target'
|
||||||
|
| 'sourcemap'
|
||||||
|
| 'skipNodeModulesBundle'
|
||||||
|
| 'noExternal'
|
||||||
|
| 'esbuildOptions'
|
||||||
|
>;
|
||||||
|
|
||||||
|
export const createTsupConfig = ({
|
||||||
|
globalName,
|
||||||
|
format = ['esm', 'cjs'],
|
||||||
|
target = 'es2021',
|
||||||
|
sourcemap = true,
|
||||||
|
minify = false,
|
||||||
|
entry = ['src/index.ts'],
|
||||||
|
skipNodeModulesBundle = true,
|
||||||
|
noExternal,
|
||||||
|
esbuildOptions = (options, context) => {
|
||||||
|
if (context.format === 'cjs') {
|
||||||
|
options.banner = {
|
||||||
|
js: '"use strict";',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}: ConfigOptions = {}) =>
|
||||||
|
defineConfig({
|
||||||
|
clean: true,
|
||||||
|
dts: true,
|
||||||
|
entry,
|
||||||
|
format,
|
||||||
|
minify,
|
||||||
|
skipNodeModulesBundle,
|
||||||
|
sourcemap,
|
||||||
|
target,
|
||||||
|
tsconfig: relative(__dirname, resolve(process.cwd(), 'tsconfig.json')),
|
||||||
|
keepNames: true,
|
||||||
|
globalName,
|
||||||
|
noExternal,
|
||||||
|
esbuildOptions,
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user