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-configThis 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-configIf 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]eslintTo install an ESLint configuration.stylelintTo install a Stylelint configuration.githookTo install a ESLint and Stylelint Git Hook commands.helpShows the help screen.
e.g.
code-config eslint
// or
npx @maarkllc/code-config stylelintAll 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/next:::available
C --> js/vue
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 has the basic configuration for JS projects.js/react: It extends fromjs/baseand adds the React plugin and rules which includes hooks.
css/base: It extends fromstylelint-config-standard.scss/base: It extends fromcss/baseandstylelint-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.