Motionstrand Docs

Motionstrand Docs

  • Docs

›Tools

Coding

  • JavaScript
  • CSS
  • PHP
  • Twig

Tools

  • Git
  • NPM/Package JSON
  • Gulp

Platform

  • Acquia Resources
  • Pantheon Resources
  • SSL/Domain Process
  • Change Management SOP
  • Cross Agency Web Development Roles and Responsibilities
  • Web Application Setup and Maintenance RACI

NPM & Package JSON

Drupal Themes

Version 1.0.4 - Added root: true to eslint config so it only runs this file. Version 1.0.3 - Now supports linting our custom module's php and .module files.

{
  "name": "mos-theme-standards",
  "version": "1.0.4",
  "description": "Motionstrand standards for Drupal development",
  "author": "motionstrand",
  "license": "ISC",
  "scripts": {
    "precommit": "lint-staged"
  },
  "lint-staged": {
    "linters": {
      "js/*.js": [
        "eslint"
      ],
      "scss/**/*.scss": [
        "stylefmt",
        "stylelint --syntax scss"
      ],
      "*.theme": [
        "phpcs --standard=Drupal"
      ],
      "../../../modules/custom/**/*.+(php|module)": [
        "phpcs --standard=Drupal"
      ]
    },
    "ignore": [
      "scss/bootstrap/*.scss",
      "scss/jquery-ui/*.scss"
    ]
  },
  "dependencies": {
    "babel-eslint": "^9.0.0",
    "eslint": "^5.4.0",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-jsx-a11y": "^6.1.1",
    "eslint-plugin-react": "^7.11.1",
    "eslint-watch": "^4.0.2",
    "gulp-autoprefixer": "^6.0.0",
    "gulp-concat": "^2.6.1",
    "gulp-sass": "^4.0.0",
    "gulp-sourcemaps": "^2.6.1",
    "gulp-uglify": "^3.0.0",
    "husky": "^0.14.3",
    "lint-staged": "^7.3.0",
    "stylefmt": "^6.0.2",
    "stylelint": "^9.5.0",
    "stylelint-config-standard": "^18.2.0"
  },
  "eslintConfig": {
    "root": true,
    "extends": "airbnb",
    "parser": "babel-eslint",
    "env": {
      "browser": true,
      "node": true
    },
    "globals": {
      "angular": true,
      "jQuery": true,
      "module": true,
      "inject": true,
      "document": true,
      "Drupal": true,
      "drupalSettings": true,
      "drupalTranslations": true,
      "domready": true,
      "_": true,
      "matchMedia": true,
      "Backbone": true,
      "Modernizr": true,
      "CKEDITOR": true,
      "Vimeo": true,
      "dataLayer": true
    },
    "rules": {
      "no-console": 0,
      "nomen": 0,
      "prefer-arrow-callback": 0,
      "func-names": 0,
      "space-before-function-paren": 0,
      "eqeqeq": 0,
      "strict": 0,
      "lines-around-directive": 0,
      "no-unused-vars": 0,
      "wrap-iife": 0,
      "no-param-reassign": 0,
      "object-shorthand": 0,
      "prefer-template": 0,
      "no-return-assign": 0,
      "no-use-before-define": 0,
      "consistent-return": 0,
      "prefer-destructuring": 0,
      "no-useless-escape": 0,
      "no-mixed-operators": 0,
      "yoda": 0,
      "no-shadow": 0,
      "max-len": [
        "error",
        {
          "code": 150,
          "ignoreRegExpLiterals": true
        }
      ],
      "brace-style": [
        "error",
        "stroustrup"
      ],
      "array-element-newline": [
        "error",
        {
          "minItems": 3
        }
      ],
      "array-bracket-newline": [
        "error",
        {
          "multiline": true,
          "minItems": 3
        }
      ],
      "object-property-newline": [
        "error",
        {
          "allowAllPropertiesOnSameLine": false
        }
      ],
      "object-curly-spacing": [
        "error",
        "never"
      ]
    }
  },
  "stylelint": {
    "extends": "stylelint-config-standard",
    "rules": {
      "selector-pseudo-element-colon-notation": "single",
      "function-name-case": null,
      "rule-empty-line-before": null,
      "at-rule-no-unknown": null,
      "at-rule-empty-line-before": null,
      "color-hex-case": null,
      "font-family-no-missing-generic-family-keyword": null,
      "no-descending-specificity": null,
      "declaration-empty-line-before": null
    }
  },
  "devDependencies": {
    "gulp": "^4.0.2"
  }
}

See also: Gulp

← GitGulp →
Facebook Open Source
Copyright © 2024 Motionstrand