Commit ba351a18 authored by Ben Mullins's avatar Ben Mullins Committed by Tim Plunkett
Browse files

Issue #3280765 by bnjmnm: Integrate eslint into build process (incl .svelte files)

parent 2ae4415e
Loading
Loading
Loading
Loading

sveltejs/.eslintrc.js

0 → 100644
+142 −0
Original line number Diff line number Diff line
module.exports = {
  parserOptions: {
    ecmaVersion: 2019,
    sourceType: 'module',
  },
  extends: [
    'airbnb-base',
    'plugin:import/recommended',
  ],
  root: true,
  env: {
    es6: true,
    browser: true,
  },
  plugins: [
    'svelte3',
  ],
  overrides: [
    {
      files: ['*.svelte'],
      processor: 'svelte3/svelte3',
    },
  ],
  globals: {
    Drupal: true,
    drupalSettings: true,
    drupalTranslations: true,
    jQuery: true,
    _: true,
    Cookies: true,
    Backbone: true,
    Modernizr: true,
    loadjs: true,
    Popper: true,
    Shepherd: true,
    Sortable: true,
    once: true,
    CKEDITOR: true,
    CKEditor5: true,
    tabbable: true,
  },
  rules: {
    'consistent-return': ['off'],
    'no-underscore-dangle': ['off'],
    'max-nested-callbacks': ['warn', 3],
    'import/no-mutable-exports': ['off'],
    'import/no-extraneous-dependencies': ['off'],
    'import/first': ['off'],
    'no-plusplus': ['warn', {
      allowForLoopAfterthoughts: true,
    }],
    'no-param-reassign': ['off'],
    'no-prototype-builtins': ['off'],
    'valid-jsdoc': ['warn', {
      prefer: {
        returns: 'return',
        property: 'prop',
      },
      requireReturn: false,
    }],
    'no-unused-vars': ['warn'],
    'max-len': ['off'],
    // Rules to disable because Prettier is enforced. This would typically be
    // achieved by extending plugin/prettier/recommended, but this results in
    // conflicts that can be addressed by simply adding the rules manually
    // below:
    'array-bracket-newline': ['off'],
    'array-bracket-spacing': ['off'],
    'array-element-newline': ['off'],
    'arrow-parens': ['off'],
    'arrow-spacing': ['off'],
    'block-spacing': ['off'],
    'brace-style': ['off'],
    'comma-dangle': ['off'],
    'comma-spacing': ['off'],
    'comma-style': ['off'],
    'computed-property-spacing': ['off'],
    'dot-location': ['off'],
    'eol-last': ['off'],
    'func-call-spacing': ['off'],
    'function-call-argument-newline': ['off'],
    'function-paren-newline': ['off'],
    'generator-star': ['off'],
    'generator-star-spacing': ['off'],
    'implicit-arrow-linebreak': ['off'],
    'indent': ['off'],
    'jsx-quotes': ['off'],
    'key-spacing': ['off'],
    'keyword-spacing': ['off'],
    'linebreak-style': ['off'],
    'multiline-ternary': ['off'],
    'newline-per-chained-call': ['off'],
    'new-parens': ['off'],
    'no-arrow-condition': ['off'],
    'no-comma-dangle': ['off'],
    'no-extra-parens': ['off'],
    'no-extra-semi': ['off'],
    'no-floating-decimal': ['off'],
    'no-mixed-spaces-and-tabs': ['off'],
    'no-multi-spaces': ['off'],
    'no-multiple-empty-lines': ['off'],
    'no-reserved-keys': ['off'],
    'no-space-before-semi': ['off'],
    'no-trailing-spaces': ['off'],
    'no-whitespace-before-property': ['off'],
    'no-wrap-func': ['off'],
    'nonblock-statement-body-position': ['off'],
    'object-curly-newline': ['off'],
    'object-curly-spacing': ['off'],
    'object-property-newline': ['off'],
    'one-var-declaration-per-line': ['off'],
    'operator-linebreak': ['off'],
    'padded-blocks': ['off'],
    'quote-props': ['off'],
    'rest-spread-spacing': ['off'],
    'semi': ['off'],
    'semi-spacing': ['off'],
    'semi-style': ['off'],
    'space-after-function-name': ['off'],
    'space-after-keywords': ['off'],
    'space-before-blocks': ['off'],
    'space-before-function-paren': ['off'],
    'space-before-function-parentheses': ['off'],
    'space-before-keywords': ['off'],
    'space-in-brackets': ['off'],
    'space-in-parens': ['off'],
    'space-infix-ops': ['off'],
    'space-return-throw-case': ['off'],
    'space-unary-ops': ['off'],
    'space-unary-word-ops': ['off'],
    'switch-colon-spacing': ['off'],
    'template-curly-spacing': ['off'],
    'template-tag-spacing': ['off'],
    'unicode-bom': ['off'],
    'wrap-iife': ['off'],
    'wrap-regex': ['off'],
    'yield-star-spacing': ['off'],
    'standard/array-bracket-even-spacing': ['off'],
    'standard/computed-property-even-spacing': ['off'],
    'standard/object-curly-even-spacing': ['off'],
  },
};
+2 −0
Original line number Diff line number Diff line
public/build
.eslintrc.js
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
{
  "printWidth": 80,
  "semi": true,
  "singleQuote": true,
  "trailingComma": "all",
  "plugins": ["prettier-plugin-svelte"]
}
+17 −2
Original line number Diff line number Diff line
@@ -2,17 +2,32 @@
  "name": "drupal-project-browser",
  "version": "1.0.0",
  "private": true,
  "engines": {
    "yarn": ">= 1.6",
    "node": ">= 16.0"
  },
  "scripts": {
    "build": "yarn yarncheck && rollup -c",
    "dev": "yarn yarncheck && rollup -c -w",
    "start": "yarn yarncheck && sirv public --no-clear",
    "start": "sirv public --no-clear",
    "preinstall": "yarn yarncheck",
    "yarncheck": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('Application requires Yarn. Do not use NPM or other package managers')\""
    "yarncheck": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('Application requires Yarn. Do not use NPM or other package managers')\"",
    "lint:svelte": "node ./node_modules/eslint/bin/eslint.js . --quiet --ext .svelte && yarn prettier:svelte-check",
    "prettier:svelte": "prettier --write \"src/**/*.svelte\"",
    "prettier:svelte-check": "prettier --check \"src/**/*.svelte\""
  },
  "devDependencies": {
    "@rollup/plugin-commonjs": "^17.0.0",
    "@rollup/plugin-json": "^4.1.0",
    "@rollup/plugin-node-resolve": "^11.0.0",
    "eslint": "^8.9.0",
    "eslint-config-airbnb-base": "^15.0.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-prettier": "^4.0.0",
    "eslint-plugin-svelte3": "^4.0.0",
    "prettier": "^2.1.2",
    "prettier-plugin-svelte": "^2.7.0",
    "rollup": "^2.3.4",
    "rollup-plugin-css-only": "^3.1.0",
    "rollup-plugin-livereload": "^2.0.0",
+0 −0

File changed.

Preview suppressed by a .gitattributes entry or the file's encoding is unsupported.

Loading