Home > Software engineering >  react - eslint config - how to disable package that is blocking commits
react - eslint config - how to disable package that is blocking commits

Time:12-28

Something in my react app is preventing me from push to github.

The error message when I try says:

✖ eslint --fix --config .eslintrc.commit.js failed without output (KILLED).

At this point, I don't care if I don't check for perfect code, I just want to push it so I can keep working from my laptop.

Does anyone know how to disable whatever prevents the commit?

My eslint.commit.js has:

module.exports = {
  extends: ["./.eslintrc.js"],
  plugins: ["simple-import-sort"],
  rules: {
    "@typescript-eslint/consistent-type-imports": "error",
    "simple-import-sort/imports": [
      "error",
      { groups: [["^react", "^@?\\w", "^\\u0000"], ["^"], ["^lib?\\w", "^components?\\w"], ["^\\."]] },
    ],
  },
}

my eslintrc.js has:

module.exports = {
  extends: ["../../.eslintrc.js", "next"],
  ignorePatterns: ["./src/lib/graphql.tsx"],
  rules: {
    "jsx-a11y/anchor-is-valid": "off",
    "no-extend-native": "off",
    "react/prop-types": "off",
    "react/display-name": "off",
    "react/no-unescaped-entities": "off",
    "@typescript-eslint/prefer-interface": "off",
    "@typescript-eslint/array-type": "off",
    "@typescript-eslint/no-use-before-define": "off",
    "@typescript-eslint/ban-ts-ignore": "off",
    "@typescript-eslint/no-angle-bracket-type-assertion": "off",
    "@typescript-eslint/explicit-module-boundary-types": "off",
  },
  settings: {
    next: {
      rootDir: "./**/src",
    },
    react: {
      version: "detect",
    },
  },
}

CodePudding user response:

You have a pre-commit hook that insists on linting passing before you commit.

You can bypass your pre-commit hooks by giving the -n option to git commit:

git commit -n

Of course, that won't fix whatever is wrong with your eslint configuration, but it will let you commit and push your current work, like you asked.

  • Related