@srclaunch/dx
v3.19.28
Published
Quality of life configuration and tooling for development environments.
Downloads
5
Readme
@srclaunch/dx
Includes the following configuration and linters:
| Linter | Description |
|:-------|:------------|
| eslint
| ESLint is a JavaScript code quality tool that checks your code for errors, helps you write better code, and rewards you for writing it. |
| prettier
| Prettier is a tool to format your code according to a preset style. |
| stylelint
| Stylelint is a mighty, modern linter that helps you avoid errors and enforce conventions in your styles.|
| commitlint
| Commitlint is a tool to enforce a consistent commit message format. |
| Configuration | Description |
| -------| ------------------ |
| typescript
| TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale. |
| jest
| Jest is a delightful JavaScript Testing Framework with a focus on simplicity. |
| ava
| AVA is a test runner for Node.js with a concise API, detailed error output, embrace of new language features and process isolation that lets you develop with confidence. |
| standard-version
| Standard Version is utility for versioning using semver and CHANGELOG generation powered by Conventional Commits. |
Instructions
Installation
Install each of the following dependencies you choose to use.
| Linter/Configuration | Command |
|:---------------------|:--------|
| eslint
| npm i -D eslint eslint-config-prettier eslint-config-stylelint eslint-import-resolver-typescript eslint-plugin-functional eslint-plugin-import eslint-plugin-node eslint-plugin-only-warn eslint-plugin-prettier eslint-plugin-simple-import-sort eslint-plugin-sort-keys-fix eslint-plugin-sort-requires eslint-plugin-testing-library eslint-plugin-unicorn @typescript-eslint/parser @typescript-eslint/eslint-plugin
or yarn add eslint eslint-config-prettier eslint-config-stylelint eslint-import-resolver-typescript eslint-plugin-functional eslint-plugin-import eslint-plugin-node eslint-plugin-only-warn eslint-plugin-prettier eslint-plugin-simple-import-sort eslint-plugin-sort-keys-fix eslint-plugin-sort-requires eslint-plugin-testing-library eslint-plugin-unicorn @typescript-eslint/parser @typescript-eslint/eslint-plugin -D
|
| prettier
| npm i -D prettier
or yarn add prettier -D
|
| stylelint
| npm i -D stylelint
or yarn add stylelint stylelint-config-idiomatic-order stylelint-config-prettier stylelint-config-recommended stylelint-order -D
|
| commitlint
| npm i -D @commitlint/config-conventional @commitlint/cli
or yarn add @commitlint/config-conventional @commitlint/cli -D
|
| typescript
| npm i -D typescript
or yarn add typescript -D
|
| jest
| npm i -D jest
or yarn add jest -D
|
| ava
| npm i -D ava
or yarn add ava -D
|
| standard-version
| npm i -D standard-version
or yarn add standard-version -D
|
prettier stylelint commitlint typescript jest ava standard-version
With npm:
`npm install --save-dev @srclaunch/dx`
Or with yarn:
yarn add @srclaunch/dx -D
The eslint
, prettier
, and standard-version
tools loads the configuration files using CommonJS/require
, so we need to use the .cjs
file extension and require
syntax to load the configuration if your package is using ESM. Use the filenames below and place in the root directory of your project.
Examples
ESLint
.eslintrc.cjs
const base = require("@srclaunch/dx/.eslintrc");
module.exports = {
...base,
// Any custom config here...
};
Use @srclaunch/dx/.eslintrc.browser
for configuration optimized for frontend development.
const base = require("@srclaunch/dx/.eslintrc.browser");
module.exports = {
...base,
// Any custom config here...
};
Prettier
.prettierrc.cjs
const base = require("@srclaunch/dx/.prettierrc");
module.exports = {
...base,
// Any custom config here...
};
Stylelint
.stylelintrc.js
import base from "@srclaunch/dx/.stylelintrc";
export default {
...base,
// Any custom config here...
};
Use @srclaunch/dx/.stylelintrc.ui
for configuration optimized for frontend development.
import base from "@srclaunch/dx/.stylelintrc.ui";
export default {
...base,
// Any custom config here...
};
Commitlint - Conventional commits
.commitlintrc.js
import base from "@srclaunch/dx/.commitlintrc";
export default {
commitlint: {
...base,
// Any custom config here...
},
};
Typescript
tsconfig.json
{
"extends": "@srclaunch/dx/tsconfig.json",
"include": ["src"]
}
For a Typescript configuration optimized for frontend development extend @srclaunch/dx/tsconfig.ui.json
.
{
"extends": "@srclaunch/dx/tsconfig.ui.json",
"include": ["src"]
}
Jest
jest.config.js
import base from "@srclaunch/dx/jest.config";
export default {
...base,
// Any custom config here...
};
AVA
ava.config.js
import base from "@srclaunch/dx/ava.config";
export default {
...base,
// Any custom config here...
};
Standard Version
.versionrc.cjs
const base = require("@srclaunch/dx/.versionrc");
module.exports = {
...base,
// Any custom config here...
};