Skip to content

Latest commit

 

History

History
97 lines (79 loc) · 1.85 KB

README.md

File metadata and controls

97 lines (79 loc) · 1.85 KB

Preferred eslint config

Trying to lighten the neutron star that is core/package.json.

Opinionated lint requirements on top of CMS cores for custom themes.

Usage

npm i --save-dev @almunnings/eslint-config

.eslintrc

{
  "extends": ["@almunnings/eslint-config/drupal"],
  "root": true
}

.stylelintrc

{
  "extends": ["@almunnings/eslint-config/style"]
}

.prettierrc.js

module.exports = {
  ...require("@almunnings/eslint-config/prettier"),
};

or

package.json

{
  "devDependencies": {
    "@almunnings/eslint-config": "^0.0.3"
  },
  "eslintConfig": {
    "extends": ["@almunnings/eslint-config/drupal"],
    "root": true
  },
  "stylelint": { "extends": ["@almunnings/eslint-config/style"] },
  "prettier": "@almunnings/eslint-config/prettier"
}

Vscode

Recommended addons

  • EsLint
  • Prettier - Code formatter
  • Stylelint

Recommended settings

  "[javascript]": {
    "editor.formatOnSave": false,
    "editor.formatOnType": false,
    "editor.formatOnPaste": false,
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": true
    },
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[scss]": {
    "editor.formatOnSave": true,
    "editor.formatOnType": false,
    "editor.formatOnPaste": false,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.codeActionsOnSave": {
      "source.fixAll.stylelint": true
    }
  },
  "[vue]": {
    "editor.formatOnSave": true,
    "editor.formatOnType": false,
    "editor.formatOnPaste": false,
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": true,
      "source.fixAll.stylelint": true
    },
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "javascript.format.insertSpaceBeforeFunctionParenthesis": false,