Skip to content

Instantly share code, notes, and snippets.

@codfish
Last active May 6, 2024 18:12

Revisions

  1. codfish revised this gist May 6, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    My personal & professional linting setup. Extends airbnb's ESLint config first, then Prettier. Run's Prettier as an ESLint rule via their ESLint plugin. Dynamic support for react or non-react applications depending on your project dependencies. Dynamic inclusion of Kent C Dodds' ESLint Jest config depending on your project dependencies.
    My personal & professional linting setup. Run's Prettier as an ESLint rule via their ESLint plugin. Dynamic support for react or non-react applications depending on your project dependencies. Dynamic inclusion of Kent C Dodds' ESLint Jest config depending on your project dependencies.

    Convenient opt-in configs for projects using Docker or Ethereum to avoid common false positives.

  2. codfish revised this gist Mar 7, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ My personal & professional linting setup. Extends airbnb's ESLint config first,

    Convenient opt-in configs for projects using Docker or Ethereum to avoid common false positives.

    To understand more, see https://github.com/codfish/eslint-config-codfish.
    To understand more, see <https://github.com/codfish/eslint-config-codfish>.

    To avoid having to manually setup everything and add all configuration/boilerplate code to your project, use [cod-scripts](https://github.com/codfish/cod-scripts) instead. It was forked from [kcd-scripts](https://github.com/kentcdodds/kcd-scripts) and ultimately inspired by `react-scripts`.

  3. codfish revised this gist Feb 20, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ Full usage: https://github.com/codfish/cod-scripts#usage

    - Delete configuration.
    ```sh
    rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .prettierignore jest.config.js .commitlintrc* commitlint* .markdownlint*
    sh -c 'rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .prettierignore jest.config.js .commitlintrc* commitlint* .markdownlint*'
    ```
    - Delete any configs from the package.json, i.e. `jest`.
    - Update `package.json` with the following:
  4. codfish revised this gist Apr 18, 2020. 8 changed files with 42 additions and 23 deletions.
    30 changes: 18 additions & 12 deletions #linting.md
    Original file line number Diff line number Diff line change
    @@ -37,8 +37,7 @@ rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .
    ```json
    "eslintConfig": {
    "extends": [
    "./node_modules/cod-scripts/eslint.js",
    "codfish/dapp"
    "./node_modules/cod-scripts/eslint.js"
    ]
    },
    "husky": {
    @@ -48,15 +47,22 @@ rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .
    }
    }
    ```
    - Adding `eslintConfig` to package.json is not required in theory but helps your editor enforce your eslint configuration.
    - Add desired scripts to `package.json`
    - Adding `eslintConfig` to package.json is not required in theory but helps your editor enforce your eslint configuration.
    - If you're building a dapp, you can extend `codfish/dapp` as well to adjust some eslint rules that throw false positive errors.
    ```json
    "scripts": {
    "build": "cod-scripts build",
    "build:watch": "npm run build -- --watch",
    "format": "cod-scripts format",
    "lint": "cod-scripts lint",
    "test": "cod-scripts test",
    "validate": "cod-scripts validate"
    }
    "eslintConfig": {
    "extends": [
    "./node_modules/cod-scripts/eslint.js",
    "codfish/dapp"
    ]
    },
    ```
    - Add desired scripts to `package.json`

    ## Source Configuration

    - [.eslintignore](https://github.com/codfish/cod-scripts/blob/master/src/config/eslintignore)
    - [.eslintrc.js](https://github.com/codfish/cod-scripts/blob/master/src/config/eslintrc.js)
    - [.prettierignore](https://github.com/codfish/cod-scripts/blob/master/src/config/prettierignore)
    - [.prettierrc.js](https://github.com/codfish/cod-scripts/blob/master/src/config/prettierrc.js)
    - [.commitlint.config.js](https://github.com/codfish/cod-scripts/blob/master/src/config/commitlint.config.js)
    1 change: 0 additions & 1 deletion .eslintignore
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    # see https://github.com/codfish/cod-scripts/blob/master/src/config/eslintignore
    1 change: 0 additions & 1 deletion .eslintrc.js
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/eslintrc.js
    6 changes: 0 additions & 6 deletions .huskyrc.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    module.exports = {
    hooks: {
    'pre-commit': 'lint-staged',
    'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS'
    },
    };
    1 change: 0 additions & 1 deletion .prettierignore
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    # see https://github.com/codfish/cod-scripts/blob/master/src/config/prettierignore
    1 change: 0 additions & 1 deletion .prettierrc.js
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/prettierrc.js
    1 change: 0 additions & 1 deletion commitlint.config.js
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/commitlint.config.js
    24 changes: 24 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,31 @@
    "build:watch": "npm run build -- --watch",
    "format": "cod-scripts format",
    "lint": "cod-scripts lint",
    "lint:commit": "cod-scripts commitlint",
    "test": "cod-scripts test",
    "validate": "cod-scripts validate"
    },
    "eslintConfig": {
    "extends": [
    "./node_modules/cod-scripts/eslint.js"
    ]
    },
    "husky": {
    "hooks": {
    "pre-commit": "cod-scripts pre-commit",
    "commit-msg": "cod-scripts commitlint -E HUSKY_GIT_PARAMS"
    }
    },
    "commitlint": {
    "extends": [
    "./node_modules/cod-scripts/commitlint"
    ],
    "rules": {
    "scope-case": [2, "always", "pascal-case"],
    "scope-enum": [2, "always", [
    "SomeComponent",
    "SomeOtherComponent"
    ]]
    }
    }
    }
  5. codfish revised this gist Mar 28, 2020. 2 changed files with 0 additions and 9 deletions.
    8 changes: 0 additions & 8 deletions .markdownlint.json
    Original file line number Diff line number Diff line change
    @@ -1,8 +0,0 @@
    {
    "default": true,
    "line-length": {
    "line_length": 100,
    "code_blocks": false,
    "tables": false
    }
    }
    1 change: 0 additions & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,6 @@
    "build:watch": "npm run build -- --watch",
    "format": "cod-scripts format",
    "lint": "cod-scripts lint",
    "lint:md": "markdownlint -i node_modules -i dist .",
    "test": "cod-scripts test",
    "validate": "cod-scripts validate"
    }
  6. codfish revised this gist Mar 28, 2020. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,6 @@ rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .
    "build:watch": "npm run build -- --watch",
    "format": "cod-scripts format",
    "lint": "cod-scripts lint",
    "lint:md": "markdownlint -i node_modules -i dist .",
    "test": "cod-scripts test",
    "validate": "cod-scripts validate"
    }
  7. codfish revised this gist Mar 28, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ Full usage: https://github.com/codfish/cod-scripts#usage

    - Delete configuration.
    ```sh
    rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .prettierignore jest.config.js .commitlintrc* commitlint*
    rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .prettierignore jest.config.js .commitlintrc* commitlint* .markdownlint*
    ```
    - Delete any configs from the package.json, i.e. `jest`.
    - Update `package.json` with the following:
  8. codfish revised this gist Feb 28, 2020. No changes.
  9. codfish revised this gist Feb 28, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -37,7 +37,8 @@ rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .
    ```json
    "eslintConfig": {
    "extends": [
    "./node_modules/cod-scripts/eslint.js"
    "./node_modules/cod-scripts/eslint.js",
    "codfish/dapp"
    ]
    },
    "husky": {
  10. codfish revised this gist Dec 20, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ There has to be a very good reason for an override: https://github.com/codfish/e
    You may be able to uninstall a number of top-level dependencies from your project but **be careful**.

    ```sh
    npm uninstall @babel/core @babel/cli @babel/preset-env @babel/preset-react eslint eslint-config-codfish prettier husky lint-staged jest @commitlint/cli @commitlint/config-conventional
    npm uninstall @babel/core @babel/cli @babel/preset-env @babel/preset-react eslint eslint-config-codfish prettier husky lint-staged jest @commitlint/cli @commitlint/config-conventional markdownlint-cli
    npm install --save-dev cod-scripts
    npm install --save @babel/runtime
    ```
  11. codfish revised this gist Oct 3, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -51,7 +51,7 @@ rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .
    - Add desired scripts to `package.json`
    ```json
    "scripts": {
    "build": "cod-scripts build -d core",
    "build": "cod-scripts build",
    "build:watch": "npm run build -- --watch",
    "format": "cod-scripts format",
    "lint": "cod-scripts lint",
  12. codfish revised this gist Sep 22, 2019. 7 changed files with 7 additions and 7 deletions.
    2 changes: 1 addition & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -43,7 +43,7 @@ rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .
    "husky": {
    "hooks": {
    "pre-commit": "cod-scripts pre-commit",
    "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    "commit-msg": "cod-scripts commitlint -E HUSKY_GIT_PARAMS"
    }
    }
    ```
    2 changes: 1 addition & 1 deletion .eslintignore
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    # see https://github.com/codfish/cod-scripts/blob/master/src/config/eslintignore
    # see https://github.com/codfish/cod-scripts/blob/master/src/config/eslintignore
    2 changes: 1 addition & 1 deletion .eslintrc.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/eslintrc.js
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/eslintrc.js
    2 changes: 1 addition & 1 deletion .prettierignore
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    # see https://github.com/codfish/cod-scripts/blob/master/src/config/prettierignore
    # see https://github.com/codfish/cod-scripts/blob/master/src/config/prettierignore
    2 changes: 1 addition & 1 deletion .prettierrc.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/prettierrc.js
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/prettierrc.js
    2 changes: 1 addition & 1 deletion commitlint.config.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/commitlint.config.js
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/commitlint.config.js
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@
    "test": "cod-scripts test",
    "validate": "cod-scripts validate"
    }
    }
    }
  13. codfish revised this gist Sep 19, 2019. 2 changed files with 3 additions and 11 deletions.
    4 changes: 2 additions & 2 deletions #linting.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ There has to be a very good reason for an override: https://github.com/codfish/e
    You may be able to uninstall a number of top-level dependencies from your project but **be careful**.

    ```sh
    npm uninstall @babel/core @babel/cli @babel/preset-env @babel/preset-react eslint eslint-config-codfish prettier husky lint-staged jest
    npm uninstall @babel/core @babel/cli @babel/preset-env @babel/preset-react eslint eslint-config-codfish prettier husky lint-staged jest @commitlint/cli @commitlint/config-conventional
    npm install --save-dev cod-scripts
    npm install --save @babel/runtime
    ```
    @@ -30,7 +30,7 @@ Full usage: https://github.com/codfish/cod-scripts#usage

    - Delete configuration.
    ```sh
    rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .prettierignore jest.config.js
    rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .prettierignore jest.config.js .commitlintrc* commitlint*
    ```
    - Delete any configs from the package.json, i.e. `jest`.
    - Update `package.json` with the following:
    10 changes: 1 addition & 9 deletions commitlint.config.js
    Original file line number Diff line number Diff line change
    @@ -1,9 +1 @@
    module.exports = {
    extends: ['@commitlint/config-conventional'],
    'scope-enum': [2, 'always', [
    // only allow scopes listed here
    ]],
    // https://conventional-changelog.github.io/commitlint/#/reference-rules?id=scope-case
    // change this depending on your project. pascal-case works well for react components
    'scope-case': [2, 'always', 'pascal-case'],
    };
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/commitlint.config.js
  14. codfish revised this gist Sep 17, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ There has to be a very good reason for an override: https://github.com/codfish/e
    You may be able to uninstall a number of top-level dependencies from your project but **be careful**.

    ```sh
    npm uninstall @babel/core @babel/cli @babel/preset-env @babel/preset-react eslint eslint-config-codfish prettier husky lint-staged
    npm uninstall @babel/core @babel/cli @babel/preset-env @babel/preset-react eslint eslint-config-codfish prettier husky lint-staged jest
    npm install --save-dev cod-scripts
    npm install --save @babel/runtime
    ```
  15. codfish revised this gist Sep 16, 2019. 8 changed files with 65 additions and 69 deletions.
    61 changes: 53 additions & 8 deletions #linting.md
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,62 @@
    My personal & professional linting setup. Extends airbnb's ESLint config first, then Prettier. Run's Prettier as an ESLint rule via their ESLint plugin. Dynamic support for react or non-react applications depending on your project dependencies. Dynamic inclusion of Kent C Dodds' ESLint Jest config depending on your project dependencies. Ultimate goal is maximize code linting coverage, leveraging the power of Prettier while deferring to Airbnb's style guide AS MUCH as possible without breaking anything. Convenient opt-in configs for projects using Docker or Ethereum to avoid common false positives. To understand more, see https://github.com/codfish/eslint-config-codfish.
    My personal & professional linting setup. Extends airbnb's ESLint config first, then Prettier. Run's Prettier as an ESLint rule via their ESLint plugin. Dynamic support for react or non-react applications depending on your project dependencies. Dynamic inclusion of Kent C Dodds' ESLint Jest config depending on your project dependencies.

    Convenient opt-in configs for projects using Docker or Ethereum to avoid common false positives.

    To understand more, see https://github.com/codfish/eslint-config-codfish.

    To avoid having to manually setup everything and add all configuration/boilerplate code to your project, use [cod-scripts](https://github.com/codfish/cod-scripts) instead. It was forked from [kcd-scripts](https://github.com/kentcdodds/kcd-scripts) and ultimately inspired by `react-scripts`.

    ## Why

    Ultimate goal is maximize code linting coverage, leveraging the power of Prettier while deferring to Airbnb's style guide AS MUCH as possible without breaking anything. Idea being that Airbnb's styleguide happens to be the most popular, well documented, and well maintained open-source JS styleguide.

    I typically work in very large teams where consensus can be difficult, and linting is like politics, people are generally passionate and rarely unopinionated. I've found that, while we all may not agree on everything in Airbnb's approach, sticking to a styleguide like theirs and avoiding opinionated overrides has had the most success across the teams I've worked on. It also helps relieve the burden of maintaining a custom set of rules (as well as the documentation).

    There has to be a very good reason for an override: https://github.com/codfish/eslint-config-codfish/blob/2444e8b63426d8cea1e6da47bce1561278ddd2c2/index.js#L19

    ## Installation

    You may be able to uninstall a number of top-level dependencies from your project but **be careful**.

    ```sh
    npm install --save-dev prettier husky lint-staged @commitlint/cli @commitlint/config-conventional markdownlint-cli
    npx install-peerdeps --dev eslint-config-codfish
    npm uninstall @babel/core @babel/cli @babel/preset-env @babel/preset-react eslint eslint-config-codfish prettier husky lint-staged
    npm install --save-dev cod-scripts
    npm install --save @babel/runtime
    ```

    ## Usage

    ```js
    module.exports = {
    extends: ['codfish'],
    root: true,
    };
    Full usage: https://github.com/codfish/cod-scripts#usage

    - Delete configuration.
    ```sh
    rm -f .babelrc* .eslintrc* .eslintignore .huskyrc* .lintstagedrc* .prettierrc* .prettierignore jest.config.js
    ```
    - Delete any configs from the package.json, i.e. `jest`.
    - Update `package.json` with the following:
    ```json
    "eslintConfig": {
    "extends": [
    "./node_modules/cod-scripts/eslint.js"
    ]
    },
    "husky": {
    "hooks": {
    "pre-commit": "cod-scripts pre-commit",
    "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
    }
    ```
    - Adding `eslintConfig` to package.json is not required in theory but helps your editor enforce your eslint configuration.
    - Add desired scripts to `package.json`
    ```json
    "scripts": {
    "build": "cod-scripts build -d core",
    "build:watch": "npm run build -- --watch",
    "format": "cod-scripts format",
    "lint": "cod-scripts lint",
    "lint:md": "markdownlint -i node_modules -i dist .",
    "test": "cod-scripts test",
    "validate": "cod-scripts validate"
    }
    ```
    9 changes: 1 addition & 8 deletions .eslintignore
    Original file line number Diff line number Diff line change
    @@ -1,8 +1 @@
    package.json
    package-lock.json
    node_modules
    build
    dist
    public
    serviceWorker.js
    !.*.js
    # see https://github.com/codfish/cod-scripts/blob/master/src/config/eslintignore
    5 changes: 1 addition & 4 deletions .eslintrc.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1 @@
    module.exports = {
    extends: ['codfish'],
    root: true,
    };
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/eslintrc.js
    5 changes: 0 additions & 5 deletions .lintstagedrc.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +0,0 @@
    module.exports = {
    '*.{json,css,scss,html}': ['prettier --write', 'git add'],
    '*.md': ['prettier --write', 'markdownlint', 'git add'],
    '*.js': ['eslint --fix', 'git add'],
    };
    9 changes: 1 addition & 8 deletions .prettierignore
    Original file line number Diff line number Diff line change
    @@ -1,8 +1 @@
    package.json
    package-lock.json
    node_modules
    build
    dist
    public
    serviceWorker.js
    !.*.js
    # see https://github.com/codfish/cod-scripts/blob/master/src/config/prettierignore
    9 changes: 1 addition & 8 deletions .prettierrc.js
    Original file line number Diff line number Diff line change
    @@ -1,8 +1 @@
    // override to defer to airbnb style guide. One source of truth!
    module.exports = {
    singleQuote: true,
    trailingComma: 'all',
    printWidth: 100,
    proseWrap: 'always',
    bracketSpacing: true,
    };
    // see https://github.com/codfish/cod-scripts/blob/master/src/config/prettierrc.js
    23 changes: 0 additions & 23 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -1,23 +0,0 @@
    sudo: false

    language: node_js

    node_js: '8'

    cache:
    directories:
    - ~/.npm

    install: npm install

    script:
    - npm run lint:commit:ci
    - npm run lint:md
    - npm run lint

    after_success:
    - npx -p semantic-release@7 -c "semantic-release pre && npm publish && semantic-release post"

    branches:
    only: master

    13 changes: 8 additions & 5 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,11 @@
    {
    "scripts": {
    "format": "npm run lint -- --fix",
    "lint": "eslint .",
    "lint:commit:ci": "commitlint-travis",
    "lint:md": "markdownlint -i node_modules ."
    "build": "cod-scripts build -d core",
    "build:watch": "npm run build -- --watch",
    "format": "cod-scripts format",
    "lint": "cod-scripts lint",
    "lint:md": "markdownlint -i node_modules -i dist .",
    "test": "cod-scripts test",
    "validate": "cod-scripts validate"
    }
    }
    }
  16. codfish revised this gist Aug 28, 2019. 2 changed files with 2 additions and 2 deletions.
    3 changes: 1 addition & 2 deletions #linting.md
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,7 @@ My personal & professional linting setup. Extends airbnb's ESLint config first,
    ## Installation

    ```sh
    npm install --save-dev --save-exact prettier
    npm install --save-dev husky lint-staged @commitlint/cli @commitlint/config-conventional markdownlint-cli
    npm install --save-dev prettier husky lint-staged @commitlint/cli @commitlint/config-conventional markdownlint-cli
    npx install-peerdeps --dev eslint-config-codfish
    ```

    1 change: 1 addition & 0 deletions .commitlintrc.js → commitlint.config.js
    Original file line number Diff line number Diff line change
    @@ -4,5 +4,6 @@ module.exports = {
    // only allow scopes listed here
    ]],
    // https://conventional-changelog.github.io/commitlint/#/reference-rules?id=scope-case
    // change this depending on your project. pascal-case works well for react components
    'scope-case': [2, 'always', 'pascal-case'],
    };
  17. codfish revised this gist Aug 23, 2019. 2 changed files with 2 additions and 2 deletions.
    1 change: 1 addition & 0 deletions .prettierrc.js
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,5 @@ module.exports = {
    trailingComma: 'all',
    printWidth: 100,
    proseWrap: 'always',
    bracketSpacing: true,
    };
    3 changes: 1 addition & 2 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    {
    "scripts": {
    "fix": "npm run format && npm run lint -- --fix",
    "format": "prettier --write \"**/*.{json,css,scss,md,html}\"",
    "format": "npm run lint -- --fix",
    "lint": "eslint .",
    "lint:commit:ci": "commitlint-travis",
    "lint:md": "markdownlint -i node_modules ."
  18. codfish revised this gist Apr 5, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,6 @@
    "format": "prettier --write \"**/*.{json,css,scss,md,html}\"",
    "lint": "eslint .",
    "lint:commit:ci": "commitlint-travis",
    "lint:md": "markdownlint --ignore node_modules **/*.md"
    "lint:md": "markdownlint -i node_modules ."
    }
    }
  19. codfish revised this gist Mar 17, 2019. 4 changed files with 8 additions and 2 deletions.
    7 changes: 6 additions & 1 deletion .commitlintrc.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,8 @@
    module.exports = {
    extends: ['@commitlint/config-conventional'],
    extends: ['@commitlint/config-conventional'],
    'scope-enum': [2, 'always', [
    // only allow scopes listed here
    ]],
    // https://conventional-changelog.github.io/commitlint/#/reference-rules?id=scope-case
    'scope-case': [2, 'always', 'pascal-case'],
    };
    1 change: 1 addition & 0 deletions .eslintignore
    Original file line number Diff line number Diff line change
    @@ -5,3 +5,4 @@ build
    dist
    public
    serviceWorker.js
    !.*.js
    1 change: 1 addition & 0 deletions .prettierignore
    Original file line number Diff line number Diff line change
    @@ -5,3 +5,4 @@ build
    dist
    public
    serviceWorker.js
    !.*.js
    1 change: 0 additions & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,6 @@
    "fix": "npm run format && npm run lint -- --fix",
    "format": "prettier --write \"**/*.{json,css,scss,md,html}\"",
    "lint": "eslint .",
    "lint:commit": "commitlint .",
    "lint:commit:ci": "commitlint-travis",
    "lint:md": "markdownlint --ignore node_modules **/*.md"
    }
  20. codfish revised this gist Jan 23, 2019. 3 changed files with 36 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions #linting.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,18 @@
    My personal & professional linting setup. Wraps airbnb's ESLint config, no opinionated overrides, only small tweaks to prevent conflicts with prettier. Dynamic support for react or non-react depending on your projects dependencies. Ultimate goal is maximum code linting coverage, while deferring to Airbnb's style guide as much as possible without breaking anything. To understand more, see https://github.com/codfish/eslint-config-codfish
    My personal & professional linting setup. Extends airbnb's ESLint config first, then Prettier. Run's Prettier as an ESLint rule via their ESLint plugin. Dynamic support for react or non-react applications depending on your project dependencies. Dynamic inclusion of Kent C Dodds' ESLint Jest config depending on your project dependencies. Ultimate goal is maximize code linting coverage, leveraging the power of Prettier while deferring to Airbnb's style guide AS MUCH as possible without breaking anything. Convenient opt-in configs for projects using Docker or Ethereum to avoid common false positives. To understand more, see https://github.com/codfish/eslint-config-codfish.

    ## Installation Instructions
    ## Installation

    ```sh
    npm install --save-dev --save-exact prettier
    npm install --save-dev husky lint-staged @commitlint/cli @commitlint/config-conventional markdownlint-cli
    npx install-peerdeps --dev eslint-config-codfish
    ```

    ## Usage

    ```js
    module.exports = {
    extends: ['codfish'],
    root: true,
    };
    ```
    23 changes: 23 additions & 0 deletions .travis.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    sudo: false

    language: node_js

    node_js: '8'

    cache:
    directories:
    - ~/.npm

    install: npm install

    script:
    - npm run lint:commit:ci
    - npm run lint:md
    - npm run lint

    after_success:
    - npx -p semantic-release@7 -c "semantic-release pre && npm publish && semantic-release post"

    branches:
    only: master

    2 changes: 2 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,8 @@
    "fix": "npm run format && npm run lint -- --fix",
    "format": "prettier --write \"**/*.{json,css,scss,md,html}\"",
    "lint": "eslint .",
    "lint:commit": "commitlint .",
    "lint:commit:ci": "commitlint-travis",
    "lint:md": "markdownlint --ignore node_modules **/*.md"
    }
    }
  21. codfish revised this gist Jan 22, 2019. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,7 @@
    "scripts": {
    "fix": "npm run format && npm run lint -- --fix",
    "format": "prettier --write \"**/*.{json,css,scss,md,html}\"",
    "lint": "npm run lint:js && npm run lint:md",
    "lint:js": "eslint .",
    "lint": "eslint .",
    "lint:md": "markdownlint --ignore node_modules **/*.md"
    }
    }
  22. codfish revised this gist Jan 22, 2019. 3 changed files with 3 additions and 3 deletions.
    2 changes: 1 addition & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ My personal & professional linting setup. Wraps airbnb's ESLint config, no opini
    ## Installation Instructions

    ```sh
    npm install --save-dev --exact prettier
    npm install --save-dev --save-exact prettier
    npm install --save-dev husky lint-staged @commitlint/cli @commitlint/config-conventional markdownlint-cli
    npx install-peerdeps --dev eslint-config-codfish
    ```
    2 changes: 1 addition & 1 deletion .lintstagedrc.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    module.exports = {
    '*.{json,css,scss,html}': ['prettier --write', 'git add'],
    '*.md': ['prettier --write', 'markdownlint', 'git add'],
    '*.js': ['prettier --write', 'eslint --fix', 'git add'],
    '*.js': ['eslint --fix', 'git add'],
    };
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    {
    "scripts": {
    "fix": "npm run format && npm run lint -- --fix",
    "format": "prettier --write \"**/*.{js,json,css,scss,md,html}\"",
    "format": "prettier --write \"**/*.{json,css,scss,md,html}\"",
    "lint": "npm run lint:js && npm run lint:md",
    "lint:js": "eslint .",
    "lint:md": "markdownlint --ignore node_modules **/*.md"
  23. codfish revised this gist Jan 16, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,6 @@
    "format": "prettier --write \"**/*.{js,json,css,scss,md,html}\"",
    "lint": "npm run lint:js && npm run lint:md",
    "lint:js": "eslint .",
    "lint:md": "markdownlint **/*.md"
    "lint:md": "markdownlint --ignore node_modules **/*.md"
    }
    }
  24. codfish revised this gist Jan 15, 2019. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,8 @@
    "scripts": {
    "fix": "npm run format && npm run lint -- --fix",
    "format": "prettier --write \"**/*.{js,json,css,scss,md,html}\"",
    "lint": "eslint ."
    "lint": "npm run lint:js && npm run lint:md",
    "lint:js": "eslint .",
    "lint:md": "markdownlint **/*.md"
    }
    }
  25. codfish revised this gist Jan 15, 2019. 3 changed files with 5 additions and 10 deletions.
    2 changes: 1 addition & 1 deletion #linting.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,6 @@ My personal & professional linting setup. Wraps airbnb's ESLint config, no opini

    ```sh
    npm install --save-dev --exact prettier
    npm install --save-dev husky lint-staged @commitlint/cli @commitlint/config-conventional
    npm install --save-dev husky lint-staged @commitlint/cli @commitlint/config-conventional markdownlint-cli
    npx install-peerdeps --dev eslint-config-codfish
    ```
    12 changes: 3 additions & 9 deletions .lintstagedrc.js
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,5 @@
    module.exports = {
    "*.{json,css,scss,md,html}": [
    "prettier --write",
    "git add"
    ],
    "*.js": [
    "prettier --write",
    "eslint --fix",
    "git add"
    ],
    '*.{json,css,scss,html}': ['prettier --write', 'git add'],
    '*.md': ['prettier --write', 'markdownlint', 'git add'],
    '*.js': ['prettier --write', 'eslint --fix', 'git add'],
    };
    1 change: 1 addition & 0 deletions .prettierrc.js
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,5 @@ module.exports = {
    singleQuote: true,
    trailingComma: 'all',
    printWidth: 100,
    proseWrap: 'always',
    };
  26. codfish revised this gist Jan 12, 2019. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions .markdownlint.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    {
    "default": true,
    "line-length": {
    "line_length": 100,
    "code_blocks": false,
    "tables": false
    }
    }
  27. codfish revised this gist Dec 24, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .prettierrc.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    // override to defer to airbnb style guide. One source
    // override to defer to airbnb style guide. One source of truth!
    module.exports = {
    singleQuote: true,
    trailingComma: 'all',
  28. codfish revised this gist Dec 24, 2018. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    {
    "scripts": {
    "fix": "npm run format && npm run lint -- --fix",
    "format": "prettier --write \"**/*.{js,json,css,scss,md,html}\"",
    "lint": "eslint ."
    }
    }
  29. codfish renamed this gist Dec 22, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  30. codfish renamed this gist Dec 22, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.