
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@ttoss/config
Advanced tools
@ttoss/config is an opinionated configuration library for monorepo and packages. It contains a set of default configurations that you can use on your projects.
pnpm add -Dw @ttoss/config
Use the configs of this section on the root of your monorepo.
The easiest way to set up all monorepo configurations at once is using the @ttoss/monorepo command:
pnpm add -Dw @ttoss/monorepo
npx @ttoss/monorepo setup-monorepo
This command will automatically create all configuration files and install all necessary dependencies for ESLint, Prettier, Husky, commitlint, lint-staged, Lerna, Syncpack, and pnpm workspace.
For more details, see @ttoss/monorepo documentation.
Alternatively, you can set up each tool manually:
Install the following packages:
pnpm add -Dw eslint prettier @ttoss/eslint-config @ttoss/config
Create the .prettierrc.js file and add the following configuration:
const { prettierConfig } = require('@ttoss/config');
module.exports = prettierConfig();
Create the eslint.config.mjs file and add the following configuration:
import ttossEslintConfig from '@ttoss/eslint-config';
export default [...ttossEslintConfig];
This group of packages will only work if you have already installed ESLint and Prettier because lint-staged will run the eslint --fix command.
Install the following packages on the root of your monorepo:
pnpm add -Dw husky @commitlint/cli lint-staged
Create the .commitlintrc.js file and add the following configuration:
const { commitlintConfig } = require('@ttoss/config');
module.exports = commitlintConfig();
Create the .lintstagedrc.js file and add the following configuration:
const { lintstagedConfig } = require('@ttoss/config');
module.exports = lintstagedConfig();
The default config runs ESLint on JS/TS files, Prettier on Markdown/JSON/YAML, and automatically sorts package.json keys using sort-package-json. No additional packages needed.
Finally, configure Husky:
npm set-script prepare "husky install"
pnpm run prepare
pnpm husky add .husky/commit-msg "pnpm commitlint --edit"
pnpm husky add .husky/pre-commit "pnpm lint-staged && pnpm syncpack:list"
Lerna helps manage versioning and publishing of packages in a monorepo.
Install lerna-lite packages:
pnpm add -Dw @lerna-lite/cli @lerna-lite/version @lerna-lite/changed @lerna-lite/list
Create the lerna.json file and configure it according to your monorepo structure:
{
"$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
"version": "independent",
"npmClient": "pnpm",
"stream": true,
"command": {
"publish": {
"allowBranch": "main",
"noPrivate": true
},
"version": {
"conventionalCommits": true,
"createRelease": "github",
"message": "chore(release): publish packages",
"syncWorkspaceLock": true,
"allowPeerDependenciesUpdate": true
}
},
"ignoreChanges": ["**/__fixtures__/**", "**/tests/**"],
"packages": ["packages/*"]
}
Syncpack ensures consistent versions of dependencies across all packages in your monorepo.
Install syncpack:
pnpm add -Dw syncpack
Create the .syncpackrc.js file:
const { syncpackConfig } = require('@ttoss/config');
module.exports = syncpackConfig();
Add syncpack scripts to your root package.json:
{
"scripts": {
"syncpack:fix": "syncpack fix-mismatches",
"syncpack:list": "syncpack list-mismatches"
}
}
Create a pnpm-workspace.yaml file to define which directories contain packages:
packages:
- 'packages/*'
Adjust the packages array to match your monorepo structure. For example:
packages:
- 'packages/*'
- 'examples/*'
- 'apps/*'
Create a .gitignore file in the monorepo root to exclude common build artifacts and dependencies:
node_modules/
dist/
build/
.build/
coverage/
*.log
.env
.env.test
.cache/
.turbo
**/i18n/compiled/
**/i18n/missing/
**/i18n/unused/
tsup.config.bundled*.mjs
package-lock.json
yarn.lock
Create an .npmrc file to configure pnpm behavior:
enable-pre-post-scripts=true
engine-strict=true
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=@types*
You can use configs below to your packages folders.
Follow our tests guidelines to configure and run your tests.
Use tsup to bundle your TypeScript packages.
Install tsup on your package.
pnpm add -D tsup
Create the tsup.config.ts file on the package folder:
import { tsupConfig } from '@ttoss/config';
export const tsup = tsupConfig();
Configure the build script on package.json:
"scripts": {
"build": "tsup",
}
Install TypeScript on your package:
pnpm add -D typescript
Extend default configuration for each tsconfig.json (touch tsconfig.json) on the package folder:
{
"extends": "@ttoss/config/tsconfig.json"
}
For tests, you can extend the default test configuration tsconfig.test.json on the package tests folder:
{
"extends": "@ttoss/config/tsconfig.test.json",
"include": ["**/*.test.ts", "**/*.test.tsx"]
}
Each configuration is customizable and you can extend them with your own. For example, you can use the default .prettierrc.js file in your monorepo:
const { prettierConfig } = require('@ttoss/config');
module.exports = prettierConfig();
But, if you want to change the printWidth option, you can do so:
const { prettierConfig } = require('@ttoss/config');
module.exports = prettierConfig({
printWidth: 120,
});
You can also pass a second argument to every configuration to handle array's append or overwrite items.
const { babelConfig } = require('@ttoss/config');
// Append plugins (default)
const appendConfig = babelConfig(
{
plugins: ['@babel/plugin-proposal-class-properties'],
},
{
arrayMerge: 'append',
}
);
const overwriteConfig = babelConfig(
{
plugins: ['@babel/plugin-proposal-class-properties'],
},
{
arrayMerge: 'overwrite',
}
);
FAQs
Default configuration for packages.
The npm package @ttoss/config receives a total of 169 weekly downloads. As such, @ttoss/config popularity was classified as not popular.
We found that @ttoss/config demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.