@maarkllc/code-config
v3.0.0
Published
Collection of configurations to enforce consistent development guidelines using Maark's recommendations.
Downloads
1,116
Keywords
Readme
Code configurations
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.
Using the CLI with npx
npx @maarkllc/code-config
This will guide you through a few steps that will ultimately install the desired configuration. That's it, happy coding!
Installing the CLI globally
Alternatively, you can install the code-config
CLI globally and use it
like so:
npm i -g @maarkllc/code-config
code-config
Available commands
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
Installing configurations manually
All configurations are inside the configs/
folder, categorized by tool.
Each tool explains how to install it manually.
Supported configurations
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
ESLint
js/base
: It has the basic configuration for JS projects.js/react
: It extends fromjs/base
and adds the React plugin and rules which includes hooks.
Stylelint
css/base
: It extends fromstylelint-config-standard
.scss/base
: It extends fromcss/base
andstylelint-config-standard-scss
.
GitHook
Multi select (choose with spacebar one or more) between:
eslint
: to add hook to validate eslint.stylelint
: to add hook to validate Stylelint.
Development
For more information please refer to the documentation.