Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

js-semistandard-style

VSCode Plugins

Recommended

Nice to Have

Linter

Install ESLint and prettier-related dependencies on current project

npm install -D eslint eslint-config-prettier eslint-plugin-prettier

for Yarn, use yarn add --dev as an alternative

run the ESLint wizard

./node_modules/.bin/eslint --init

Wizard guidelines:

  1. Pick To check syntax, find problems, and enforce code style
  2. Use JavaScript modules for Typescript project, OR CommonJS for Javascript project
  3. Use None of These for NodeJS project, OR React for React project
  4. For Typescript project, please pick Yes
  5. Pick Browser for React project, otherwise Node
  6. Pick Use a popular style guide, and choose Standard
  7. Pick JavaScript as the config file format
  8. You will be prompted to install several eslint dependencies, please answer with Yes or Y

Prettier

Install prettier in your project and pin its version

npm install prettier -D --save-exact

Create .prettierrc file on project root folder.

{
  "tabWidth": 2,
  "useTabs": false,
  "printWidth": 100,
  "singleQuote": true,
  "semi": true
}

Modify your current .eslintrc.js

  1. Add prettier as plugins
  2. Append plugin:prettier/recommended on extends
// example
{
  plugins: ['prettier'],
  extends: ['standard', 'plugin:prettier/recommended'],
}

Configure VSCode plugin

Please install vscode prettier plugin and configure your default formatter.

  1. Open Settings
  2. Type Default formatter in search bar
  3. Pick esbenp.prettier-vscode as default formatter and save your setting

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors