4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,3 +1,3 @@
|
|||||||
/node_modules
|
/node_modules
|
||||||
.env
|
/dist
|
||||||
package-lock.json
|
.env
|
||||||
11
README.md
11
README.md
@@ -1,4 +1,11 @@
|
|||||||
<img align="left" style="width:128px" src="https://github.com/gractwo/assets/blob/master/logo.svg" />
|
<img align="left" style="width:128px" src="https://github.com/gractwo/assets/blob/master/logo.svg" />
|
||||||
|
|
||||||
# bot
|
# gractwo/bot
|
||||||
Gractwo bot is a Discord bot written in JavaScript, running with nodejs and making use of libraries such as discordjs.
|
|
||||||
|
The premier bot for Gractwo's discord operations.
|
||||||
|
|
||||||
|
### package scripts
|
||||||
|
|
||||||
|
- run `npm run start` to build and run the bot.
|
||||||
|
- run `npm run build` to only build the bot.
|
||||||
|
- run `npm run serve` to only run the bot.
|
||||||
|
|||||||
3664
package-lock.json
generated
3664
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
31
package.json
31
package.json
@@ -1,28 +1,29 @@
|
|||||||
{
|
{
|
||||||
"name": "discord-bot",
|
"name": "gractwo-bot",
|
||||||
"version": "1.0.0",
|
"version": "0xDEADBEEF",
|
||||||
"description": "gractwo-bot is a Discord bot written in JavaScript, using node.js and discord.js.\r It has been created for and only serves the Gractwo Discord server. It is hosted using Heroku.",
|
"description": "The premier bot for Gractwo's discord operations.",
|
||||||
"main": "src/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"start": "tsc && node .",
|
||||||
|
"build": "tsc",
|
||||||
|
"serve": "node .",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/Gractwo/discord-bot.git"
|
"url": "git+https://github.com/gractwo/bot.git"
|
||||||
},
|
},
|
||||||
"author": "github.com/jakubmanczak",
|
"author": "gractwo team",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/Gractwo/discord-bot/issues"
|
"url": "https://github.com/gractwo/bot/issues"
|
||||||
},
|
|
||||||
"homepage": "https://github.com/Gractwo/discord-bot#readme",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.10.0",
|
|
||||||
"npm": ">=7.24.0"
|
|
||||||
},
|
},
|
||||||
|
"homepage": "https://github.com/gractwo/bot#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord.js": "^13.1.0",
|
"@types/express": "^4.17.15",
|
||||||
"dotenv": "^10.0.0",
|
"discord.js": "^14.7.1",
|
||||||
"nodemon": "^2.0.13"
|
"dotenv": "^16.0.3",
|
||||||
|
"express": "^4.18.2",
|
||||||
|
"typescript": "^4.9.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
99
src/cfg.json
99
src/cfg.json
@@ -1,99 +1,6 @@
|
|||||||
{
|
{
|
||||||
"prefix": ".",
|
"api": {
|
||||||
"hexBlue": "61f2ea",
|
"fallbackPort": 2020,
|
||||||
"hexRed": "fb636b",
|
"memberCountGuildId": "447075692664979466"
|
||||||
"iconurl": "https://i.imgur.com/4AmRDyX.png",
|
|
||||||
"timeout": 4000,
|
|
||||||
"rolesList": [
|
|
||||||
"tf2",
|
|
||||||
"liga",
|
|
||||||
"csgo",
|
|
||||||
"minecraft",
|
|
||||||
"rainbow-six",
|
|
||||||
"apex",
|
|
||||||
"genshin",
|
|
||||||
"valorant"
|
|
||||||
],
|
|
||||||
"embedFields": {
|
|
||||||
"witaj": [
|
|
||||||
{
|
|
||||||
"name": "Zasady",
|
|
||||||
"value": "Zasady serwera można wywołać komendą `.regulamin`.\nZgrubsza: 'nie bądź uschłą wierzbą'. :)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gractwo WWW",
|
|
||||||
"value": "http://gractwo.pl",
|
|
||||||
"inline": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gractwo DISCORD",
|
|
||||||
"value": "http://gractwo.pl/discord",
|
|
||||||
"inline": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "DISCORD bezpośredni",
|
|
||||||
"value": "discord.gg/NBXq95C",
|
|
||||||
"inline": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gractwo TWITTER",
|
|
||||||
"value": "http://gractwo.pl/twitter",
|
|
||||||
"inline": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gractwo YOUTUBE",
|
|
||||||
"value": "http://gractwo.pl/youtube",
|
|
||||||
"inline": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gractwo GITHUB",
|
|
||||||
"value": "http://gractwo.pl/github",
|
|
||||||
"inline": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"regulamin": [
|
|
||||||
{
|
|
||||||
"name": "§1 Szacunek",
|
|
||||||
"value": "Na naszym serwerze obowiązuje szacunek do innych osób podczas niesatyrycznej dyskusji."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "§2 Spam / Trolling",
|
|
||||||
"value": "Jeżeli będziesz bezużytecznie spamować lub nieprzyjmenie się zachowywać zostaniesz zbanowany."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "§3 Bagno",
|
|
||||||
"value": "Kanał #bagno jest najbardziej wyluzowanym kanałem na naszym serwerze. Nie oznacza to jednak, że nie jest monitorowany. Jeżeli czujesz, że rzecz którą chcesz tam umieścić jest nadzwyczajnie kontrowersyjna, zastanów się dwa razy przed wciśnięciem Enter."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "§4 Poprawne Kanały",
|
|
||||||
"value": "Rozmowy na dany temat powinny toczyć się w kanałach do tego przeznaczonych."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "§5 Memy i Gify",
|
|
||||||
"value": "Memy i Gify nie są zbyt przyjemne dla oka bez kontekstu. Najlepiej jest nie postować ich, jeżeli nie pasują do prowadzonej aktualnie dyskusji."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "§6 Reklamy",
|
|
||||||
"value": "Zakaz reklam bez zezwolenia moderatora lub administratora. Pozwolenia na reklamę muszą być wydane przed jej zamieszczeniem."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "§7 Przestrzeganie Regulaminu",
|
|
||||||
"value": "Przestrzeganie regulaminu jest obowiązkowe, a to że go ktoś nie przeczytał nic nie zmienia."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "§8 Obcowanie z botem",
|
|
||||||
"value": "Próby intencjonalnego łamania bota nie są mile widziane, tak jak nadużywanie go w celach spamu kanałów."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "§9 Warunki Użytkowania Discord (ToS)",
|
|
||||||
"value": "Nasz serwer, jak każdy inny, musi przestrzegać zasad zapisanych w warunkach użytkowania Discorda. Przypominamy o nich, bo choć nie są zbyt restrykcyjne, nie pozwalają na kilka określonych rzeczy."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "§10 Braki Legislacyjne",
|
|
||||||
"value": "W razie jakichkolwiek braków legislacyjnych lub wątpliwości w interpretacji prawa polskiego wskazane jest rozważyć precedens wpisany w scenariusz Gractwo Dating Sim."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"pomocDesc": "Komenda objaśniająca bota i jego zastosowanie, a także dostępne komendy.\n\nBot Gractwa funkcjonuje jako własne rozwiązanie na problemy z administrowaniem serwera Discord. Umożliwia między innymi samo-nadawanie rolek od gier, lub odsłuchiwanie muzyki.\n\nPoniżej znajduje się lista dostępnych komend:",
|
|
||||||
"rolkiDesc": "Poniżej widnieją przyciski służące do przyznawania bądź odejmowanie sobie ról powiązanych z grami. Służą one do oznaczania wszystkich zainteresowanych daną grą na określonym kanale."
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,116 +0,0 @@
|
|||||||
const {
|
|
||||||
MessageActionRow,
|
|
||||||
MessageButton,
|
|
||||||
ButtonInteraction,
|
|
||||||
Interaction,
|
|
||||||
Client,
|
|
||||||
} = require('discord.js');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: 'embed',
|
|
||||||
execute(cl, msg, args) {
|
|
||||||
// TODO: add a permissions check here to make sure nobody can spawn msgs
|
|
||||||
// not intended outside of specific scenarios
|
|
||||||
let embed = {
|
|
||||||
color: cl.cfg.hexBlue,
|
|
||||||
// timestamp: new Date(),
|
|
||||||
// footer: {
|
|
||||||
// text: `Komenda wywołana przez ${msg.author.tag}`,
|
|
||||||
// icon_url: cl.cfg.iconurl,
|
|
||||||
// },
|
|
||||||
};
|
|
||||||
|
|
||||||
let readyMsg;
|
|
||||||
|
|
||||||
switch (args[0]) {
|
|
||||||
case 'witaj':
|
|
||||||
embed.author = {
|
|
||||||
name: 'Witajcie w Gractwie!',
|
|
||||||
icon_url: 'https://i.imgur.com/4AmRDyX.png',
|
|
||||||
};
|
|
||||||
embed.description =
|
|
||||||
'Jesteśmy grupą ludzi których kręcą gry. Proste, nie?\nSerwer ten miał wcześniej tematykę Team Fortressową.';
|
|
||||||
embed.fields = cl.cfg.embedFields.witaj;
|
|
||||||
readyMsg = { embeds: [embed] };
|
|
||||||
break;
|
|
||||||
case 'regulamin':
|
|
||||||
embed.title = 'Regulamin';
|
|
||||||
embed.description =
|
|
||||||
'Regulamin naszego serwera składa się z tego, co następuje:';
|
|
||||||
embed.footer = {
|
|
||||||
text: `Ostatnio zaktualizowany`,
|
|
||||||
icon_url: cl.cfg.iconurl,
|
|
||||||
};
|
|
||||||
embed.timestamp = new Date();
|
|
||||||
embed.fields = cl.cfg.embedFields.regulamin;
|
|
||||||
readyMsg = { embeds: [embed] };
|
|
||||||
break;
|
|
||||||
case 'rolki':
|
|
||||||
embed.author = { name: 'Rolki' };
|
|
||||||
embed.description = cl.cfg.embedFields.rolkiDesc;
|
|
||||||
embed.footer = {
|
|
||||||
text: `#witaj`,
|
|
||||||
icon_url: cl.cfg.iconurl,
|
|
||||||
};
|
|
||||||
embed.timestamp = new Date();
|
|
||||||
// code responsible for making lists of buttons out of cl.cfg.rolesList
|
|
||||||
// & including them in the readyMsg
|
|
||||||
let i = 1,
|
|
||||||
l = 0;
|
|
||||||
let btnList = [];
|
|
||||||
while (
|
|
||||||
cl.cfg.rolesList.length / 5 +
|
|
||||||
(cl.cfg.rolesList.length % 5 != 0 ? 1 : 0) >=
|
|
||||||
i
|
|
||||||
) {
|
|
||||||
let btnRow = new MessageActionRow();
|
|
||||||
for (l; l <= 5 * i - 1 && cl.cfg.rolesList[l] != undefined; l++) {
|
|
||||||
btnRow.addComponents(
|
|
||||||
new MessageButton()
|
|
||||||
.setCustomId(cl.cfg.rolesList[l])
|
|
||||||
.setLabel(`rolka ${cl.cfg.rolesList[l]}`)
|
|
||||||
.setStyle('SECONDARY')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
btnList.push(btnRow);
|
|
||||||
console.log(btnList);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
readyMsg = { embeds: [embed], components: btnList };
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
embed.title = `zły parametr: ` + args[0];
|
|
||||||
embed.color = cl.cfg.hexRed;
|
|
||||||
readyMsg = { embeds: [embed] };
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.send(readyMsg);
|
|
||||||
if (args[0] === 'rolki') {
|
|
||||||
cl.on('interactionCreate', (inter) => {
|
|
||||||
if (!inter.isButton()) return;
|
|
||||||
const role = inter.member.guild.roles.cache.find(
|
|
||||||
(role) => role.name == inter.customId
|
|
||||||
);
|
|
||||||
if (!role) return;
|
|
||||||
if (
|
|
||||||
!inter.member.roles.cache.find((role) => role.name == inter.customId)
|
|
||||||
) {
|
|
||||||
inter.member.roles.add(role);
|
|
||||||
inter
|
|
||||||
.reply('Gratulacje, dodalismy ci tą bezużyteczną rangę', {
|
|
||||||
timeout: cl.cfg.timeout,
|
|
||||||
})
|
|
||||||
.then(inter.deleteReply());
|
|
||||||
} else {
|
|
||||||
inter.member.roles.remove(role);
|
|
||||||
inter
|
|
||||||
.reply('Gratulacje, odebraliśmy ci tą bezużyteczną rangę', {
|
|
||||||
timeout: cl.cfg.timeout,
|
|
||||||
})
|
|
||||||
.then(inter.deleteReply());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
name: 'ping',
|
|
||||||
execute(cl, msg) {
|
|
||||||
const embed = {
|
|
||||||
color: cl.cfg.hexBlue,
|
|
||||||
timestamp: new Date(),
|
|
||||||
footer: {
|
|
||||||
text: `Komenda wywołana przez ${msg.author.tag}`,
|
|
||||||
icon_url: cl.cfg.iconurl,
|
|
||||||
},
|
|
||||||
title: 'Pong!',
|
|
||||||
description: `Ping jednostronny wynosi ${
|
|
||||||
Date.now() - msg.createdTimestamp
|
|
||||||
}ms.`,
|
|
||||||
};
|
|
||||||
msg.channel.send({ embeds: [embed] });
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
name: 'pomoc',
|
|
||||||
execute(cl, msg) {
|
|
||||||
const embed = {
|
|
||||||
color: cl.cfg.hexBlue,
|
|
||||||
timestamp: new Date(),
|
|
||||||
footer: {
|
|
||||||
text: `Komenda wywołana przez ${msg.author.tag}`,
|
|
||||||
icon_url: cl.cfg.iconurl,
|
|
||||||
},
|
|
||||||
title: 'Pomoc!',
|
|
||||||
description: cl.cfg.embedFields.pomocDesc,
|
|
||||||
};
|
|
||||||
msg.channel.send({ embeds: [embed] });
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
name: 'regulamin',
|
|
||||||
execute(cl, msg) {
|
|
||||||
const embed = {
|
|
||||||
color: cl.cfg.hexBlue,
|
|
||||||
timestamp: new Date(),
|
|
||||||
footer: {
|
|
||||||
text: `Komenda wywołana przez ${msg.author.tag}`,
|
|
||||||
icon_url: cl.cfg.iconurl,
|
|
||||||
},
|
|
||||||
title: 'Regulamin',
|
|
||||||
description: 'Regulamin naszego serwera składa się z tego, co następuje:',
|
|
||||||
fields: cl.cfg.embedFields.regulamin,
|
|
||||||
};
|
|
||||||
msg.channel.send({ embeds: [embed] });
|
|
||||||
},
|
|
||||||
};
|
|
||||||
66
src/index.js
66
src/index.js
@@ -1,66 +0,0 @@
|
|||||||
const discordjs = require('discord.js');
|
|
||||||
const fs = require('fs');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
const cl = new discordjs.Client({
|
|
||||||
intents: [
|
|
||||||
discordjs.Intents.FLAGS.GUILDS,
|
|
||||||
discordjs.Intents.FLAGS.GUILD_MESSAGES,
|
|
||||||
],
|
|
||||||
});
|
|
||||||
cl.cfg = require('./cfg.json');
|
|
||||||
cl.cmds = new discordjs.Collection();
|
|
||||||
|
|
||||||
const cmdsFls = fs
|
|
||||||
.readdirSync(`./src/cmds`)
|
|
||||||
.filter((file) => file.endsWith(`.js`));
|
|
||||||
for (const Fl of cmdsFls) {
|
|
||||||
const cmd = require(`./cmds/${Fl}`);
|
|
||||||
console.log(`command: ` + cmd.name);
|
|
||||||
cl.cmds.set(cmd.name, cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
cl.on('messageCreate', (msg) => {
|
|
||||||
|
|
||||||
// peak comedy
|
|
||||||
if(msg.content.toLowerCase() === "!rank" || msg.content.toLowerCase() === "!levels"){
|
|
||||||
msg.channel.send({
|
|
||||||
files: ["https://cdn.discordapp.com/attachments/281070649374670849/871103257580281876/tenor.gif"]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!msg.content.startsWith(cl.cfg.prefix) || msg.author.bot) return;
|
|
||||||
|
|
||||||
const args = msg.content.slice(cl.cfg.prefix.length).trim().split(/ +/);
|
|
||||||
const cmdName = args.shift().toLowerCase();
|
|
||||||
|
|
||||||
if (!cl.cmds.has(cmdName)) return;
|
|
||||||
const cmd = cl.cmds.get(cmdName);
|
|
||||||
|
|
||||||
try {
|
|
||||||
cmd.execute(cl, msg, args);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(
|
|
||||||
`msgCommand error: ${cmdName} with args ${args} by ${msg.author.tag}\n--\n${error}\n--`
|
|
||||||
);
|
|
||||||
msg.reply(
|
|
||||||
`An error occured while trying to execute ${cmdName} with args ${args}`
|
|
||||||
);
|
|
||||||
console.log(error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log(`msgCommand: ${cmdName + args} by ${msg.author.tag}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
cl.once('ready', () => {
|
|
||||||
console.clear();
|
|
||||||
console.log(`bot ready; logged in as ${cl.user.tag}\n--`);
|
|
||||||
cl.user.setActivity('.pomoc', { type: 'LISTENING' });
|
|
||||||
});
|
|
||||||
|
|
||||||
cl.login(process.env.token); // here comes the boooy
|
|
||||||
// hello boy
|
|
||||||
// welcome
|
|
||||||
// there he is
|
|
||||||
// he is here
|
|
||||||
30
src/index.ts
Normal file
30
src/index.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import DiscordJS from 'discord.js';
|
||||||
|
// import fs from 'fs';
|
||||||
|
import express from 'express';
|
||||||
|
import dotenv from 'dotenv';
|
||||||
|
import config from './cfg.json';
|
||||||
|
dotenv.config();
|
||||||
|
|
||||||
|
const client = new DiscordJS.Client({
|
||||||
|
intents: [DiscordJS.GatewayIntentBits.Guilds],
|
||||||
|
});
|
||||||
|
const app = express();
|
||||||
|
const port = process.env.PORT || config.api.fallbackPort;
|
||||||
|
|
||||||
|
app.get('/', (req, res) => {
|
||||||
|
res.sendStatus(200);
|
||||||
|
});
|
||||||
|
app.get('/members', (req, res) => {
|
||||||
|
res.send(
|
||||||
|
client.guilds.resolve(config.api.memberCountGuildId)?.memberCount.toString()
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
client.on('ready', () => {
|
||||||
|
console.log(`BOT: Now logged in as ${client.user?.tag}.`);
|
||||||
|
});
|
||||||
|
|
||||||
|
const api = app.listen(port, () => {
|
||||||
|
console.log(`API: Now listening on :${port}.`);
|
||||||
|
});
|
||||||
|
client.login(process.env.TOKEN);
|
||||||
103
tsconfig.json
Normal file
103
tsconfig.json
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
/* Visit https://aka.ms/tsconfig to read more about this file */
|
||||||
|
|
||||||
|
/* Projects */
|
||||||
|
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
||||||
|
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
||||||
|
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
||||||
|
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
||||||
|
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
||||||
|
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||||
|
|
||||||
|
/* Language and Environment */
|
||||||
|
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
||||||
|
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||||
|
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||||
|
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
||||||
|
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||||
|
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
||||||
|
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||||
|
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
||||||
|
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
||||||
|
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
||||||
|
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||||
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||||
|
|
||||||
|
/* Modules */
|
||||||
|
"module": "commonjs" /* Specify what module code is generated. */,
|
||||||
|
"rootDir": "./src/" /* Specify the root folder within your source files. */,
|
||||||
|
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||||
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||||
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||||
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||||
|
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
||||||
|
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||||
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||||
|
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
||||||
|
"resolveJsonModule": true /* Enable importing .json files. */,
|
||||||
|
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
||||||
|
|
||||||
|
/* JavaScript Support */
|
||||||
|
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
||||||
|
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
||||||
|
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
||||||
|
|
||||||
|
/* Emit */
|
||||||
|
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||||
|
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||||
|
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||||
|
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||||
|
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
||||||
|
"outDir": "./dist/" /* Specify an output folder for all emitted files. */,
|
||||||
|
// "removeComments": true, /* Disable emitting comments. */
|
||||||
|
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||||
|
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||||
|
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
||||||
|
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
||||||
|
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
||||||
|
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||||
|
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
||||||
|
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
||||||
|
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
||||||
|
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
||||||
|
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
||||||
|
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
||||||
|
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
||||||
|
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
||||||
|
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
||||||
|
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
||||||
|
|
||||||
|
/* Interop Constraints */
|
||||||
|
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
||||||
|
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||||
|
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
||||||
|
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
||||||
|
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
||||||
|
|
||||||
|
/* Type Checking */
|
||||||
|
"strict": true /* Enable all strict type-checking options. */,
|
||||||
|
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
||||||
|
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
||||||
|
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
||||||
|
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
||||||
|
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
||||||
|
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
||||||
|
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
||||||
|
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
||||||
|
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
||||||
|
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
||||||
|
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
||||||
|
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
||||||
|
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
||||||
|
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
||||||
|
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
||||||
|
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
||||||
|
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
||||||
|
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
||||||
|
|
||||||
|
/* Completeness */
|
||||||
|
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||||
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user