Collection of configurations to enforce consistent development guidelines using Maark's recommendations.
To install a new configuration you can either use the CLI to handle everything automatically or do it manually.
npx @maarkllc/code-config
This will guide you through a few steps that will ultimately install the desired configuration. That's it, happy coding!
Alternatively, you can install the code-config
CLI globally and use it
like so:
npm i -g @maarkllc/code-config
code-config
If you want to skip the first step you can pass the command as a parameter. This is optional because if you don't pass anything, the CLI will ask you what you want to execute.
code-config [command]
eslint
To install an ESLint configuration.stylelint
To install a Stylelint configuration.githook
To install a ESLint and Stylelint Git Hook commands.help
Shows the help screen.
e.g.
code-config eslint
// or
npx @maarkllc/code-config stylelint
All configurations are inside the configs/
folder, categorized by tool.
Each tool explains how to install it manually.
The idea is to have a structure of configurations that extend from each other as needed depending on the project stack, it is important to define rules to be able to identify anti-patterns and code-smells for specific known libraries. This diagram helps illustrate the possible configurations and how it can scale in the future to include other tools of trade for bundling or unit testing:
%%{init: {'theme':'base'}}%%
graph TD
subgraph Legend
L1[Available]:::available --> L2[Not ready]
end
A[ESLint]:::available --> B[JavaScript]:::available
B --> C[js/base]:::available
C --> D[js/react]:::available
C --> js/vue
C --> js/angular
D --> js/next
A --> E[Typescript]
F[Stylelint]:::available --> G[CSS]:::available
F --> H[SCSS]:::available
G --> css/base:::available
H --> scss/base:::available
Webpack
classDef available stroke:#0B410E,fill:#94D1BE
js/base
: It extends from Airbnb base configuration.js/react
: It extends fromjs/base
and Airbnb full configuration and hooks rules.
css/base
: It extends fromstylelint-config-standard
.scss/base
: It extends fromcss/base
andstylelint-config-standard-scss
.
Multi select (choose with spacebar one or more) between:
eslint
: to add hook to validate eslint.stylelint
: to add hook to validate Stylelint.
For more information please refer to the documentation.