@almunnings/eslint-config

0.0.7 • Public • Published

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,

Dependents (0)

Package Sidebar

Install

npm i @almunnings/eslint-config

Weekly Downloads

66

Version

0.0.7

License

MIT

Unpacked Size

16.2 kB

Total Files

9

Last publish

Collaborators

  • almunnings