Skip to content

Opinionated lint requirements on top of CMS cores for custom theme dev.

Notifications You must be signed in to change notification settings

almunnings/eslint-config

Repository files navigation

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,

About

Opinionated lint requirements on top of CMS cores for custom theme dev.

Resources

Stars

Watchers

Forks

Packages

No packages published