Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.94 KB

File metadata and controls

36 lines (28 loc) · 1.94 KB

Linting

Basys toolbox comes with a pre-configured linting for code and styles, which

  • finds issues in your code and help to follow the best practices,
  • detects and fixes formatting issues.

Linting is integrated into Basys IDE and works out of the box. If you are using Basys CLI use basys lint to print all linting errors and basys lint:fix to fix formatting issues.

Code linting

JavaScript linting, performed by ESLint and Prettier, is applied to .js and .vue files. By default eslint-config-basys is used, but you can customize ESLint rules by adding .eslintrc.* file to the project root directory. For more information see the documentation on configuring ESLint. For example, to add more rules add the following .eslintrc.js file:

module.exports = {
  extends: 'basys',
  rules: {
    // Your custom ESLint rules
  },
};

To exclude some code from being linted create .eslintignore file.

Style linting

Style linting, based on stylelint and [Prettier], is applied to .css/.less/.scss/.vue files.

By default the stylelint rules from stylelint-config-basys are used. You can customize them by adding .stylelintrc file to the project root directory (see how to configure stylelint rules). For example,

{
  "extends": "stylelint-config-basys",
  "rules": {
    // Your custom stylelint rules
  }
}

To exclude some styles from being linted (say a CSS file from a 3rd party library) use .stylelintignore file.