Skip to content

Instantly share code, notes, and snippets.

@jankalfus
Last active April 24, 2018 13:19
Show Gist options
  • Select an option

  • Save jankalfus/50d6f5fc1fb822583ab5d6ee969cee9d to your computer and use it in GitHub Desktop.

Select an option

Save jankalfus/50d6f5fc1fb822583ab5d6ee969cee9d to your computer and use it in GitHub Desktop.

Revisions

  1. jankalfus revised this gist Apr 24, 2018. 1 changed file with 9 additions and 10 deletions.
    19 changes: 9 additions & 10 deletions setup-boilerplate.md
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,7 @@

    ```
    "devDependencies": {
    "eslint-config-prettier": "^2.9.0",
    "eslint-plugin-prettier": "^2.6.0",
    "eslint-watch": "^3.1.4",
    "husky": "^0.14.3",
    "prettier": "1.12.1",
    "pretty-quick": "^1.4.1",
    @@ -17,13 +16,13 @@
    ```
    "precommit": "pretty-quick --staged && npm run lint-precommit",
    "prepush": "npm run lint-prepush",
    "lint-precommit": "npm run lint:scss && npm run lint:js",
    "lint-prepush": "npm run lint:scss && npm run lint:js-strict",
    "lint:scss": "stylelint src/**/*.scss",
    "lint:js": "eslint src/**/*.js",
    "lint:js-strict": "npm run lint:js -- --max-warnings=0"
    "lint-watch": "esw src --color --watch",
    "lint-precommit": "npm run lint-scss && npm run lint-js",
    "lint-prepush": "npm run lint-scss && npm run lint-js-strict",
    "lint-scss": "stylelint src/**/*.scss",
    "lint-js": "eslint src/**/*.js",
    "lint-js-strict": "npm run lint-js -- --max-warnings=0"--max-warnings=0"
    ```
    Note: Use only warnings in eslint config. This setup will treat any warnings as errors when attempting to push to a repository.

    # .editorconfig

    @@ -69,9 +68,9 @@ indent_size = 2

    ```
    {
    "extends": ["react-app", "plugin:prettier/recommended"],
    "extends": ["react-app"],
    "rules": {
    "no-console": "warn"
    }
    }
    ```
    ```
  2. jankalfus revised this gist Apr 24, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-boilerplate.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@
    "lint:js": "eslint src/**/*.js",
    "lint:js-strict": "npm run lint:js -- --max-warnings=0"
    ```
    Note: Use only warnings in eslint config. This setup will treat any warnings as errors when trying to push.
    Note: Use only warnings in eslint config. This setup will treat any warnings as errors when attempting to push to a repository.

    # .editorconfig

  3. jankalfus revised this gist Apr 24, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions setup-boilerplate.md
    Original file line number Diff line number Diff line change
    @@ -23,6 +23,7 @@
    "lint:js": "eslint src/**/*.js",
    "lint:js-strict": "npm run lint:js -- --max-warnings=0"
    ```
    Note: Use only warnings in eslint config. This setup will treat any warnings as errors when trying to push.

    # .editorconfig

  4. jankalfus created this gist Apr 24, 2018.
    76 changes: 76 additions & 0 deletions setup-boilerplate.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,76 @@
    # package.json dev dependencies

    ```
    "devDependencies": {
    "eslint-config-prettier": "^2.9.0",
    "eslint-plugin-prettier": "^2.6.0",
    "husky": "^0.14.3",
    "prettier": "1.12.1",
    "pretty-quick": "^1.4.1",
    "stylelint": "^9.2.0",
    "stylelint-scss": "^3.0.1"
    }
    ```

    # package.json scripts

    ```
    "precommit": "pretty-quick --staged && npm run lint-precommit",
    "prepush": "npm run lint-prepush",
    "lint-precommit": "npm run lint:scss && npm run lint:js",
    "lint-prepush": "npm run lint:scss && npm run lint:js-strict",
    "lint:scss": "stylelint src/**/*.scss",
    "lint:js": "eslint src/**/*.js",
    "lint:js-strict": "npm run lint:js -- --max-warnings=0"
    ```

    # .editorconfig

    ```
    root = true
    [*]
    end_of_line = lf
    insert_final_newline = true
    charset = utf-8
    indent_style = tab
    indent_size = 4
    max_line_length = 100
    trim_trailing_whitespace = true
    [*.json]
    indent_style = tab
    indent_size = 2
    ```

    # .stylelintrc.json

    ```
    {
    "plugins": ["stylelint-scss"]
    }
    ```

    # .prettierrc

    ```
    {
    "singleQuote": true,
    "trailingComma": "es5",
    "printWidth": 100,
    "tabWidth":4,
    "useTabs": true,
    "arrowParens": "always"
    }
    ```

    # .eslintrc.json

    ```
    {
    "extends": ["react-app", "plugin:prettier/recommended"],
    "rules": {
    "no-console": "warn"
    }
    }
    ```