Hey, I setup my project using above config. But I'm stuck with incorrect header warning. Would you please share your header file
Update[9,Nov 2020] Hey everyone, those who are having issues with author's above .eslintrc rules you can use mine. Check if it's work for you
{ "parser": "@typescript-eslint/parser", "extends": [ "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", // force to use airbnb styleguide "airbnb", "prettier", "prettier/@typescript-eslint" ], "plugins": ["@typescript-eslint", "react-hooks", "header"], "settings": { // solves import problems with tsx,ts,jsx,js files "import/resolver": { "node": { "extensions": [".js", ".jsx", ".ts", ".tsx"] } }, "react": { "version": "detect" } }, "rules": { // force to type header comment on each file "header/header": [2, "config/header.js"], // folder/filename in project directory "react/jsx-filename-extension": [2, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }], // solves import problems with tsx,ts,jsx,js files "import/extensions": [ "error", "ignorePackages", { "js": "never", "jsx": "never", "ts": "never", "tsx": "never" } ], "@typescript-eslint/consistent-type-definitions": ["warn", "type"], "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/explicit-member-accessibility": "off", "@typescript-eslint/no-angle-bracket-type-assertion": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-unused-vars": [ "error", { "argsIgnorePattern": "^_", "ignoreRestSiblings": true } ], // solve React defined problem "no-use-before-define": "off", "@typescript-eslint/no-use-before-define": [ "warn", { "functions": false, "classes": false, "variables": true } ], "import/no-extraneous-dependencies": "warn", "import/order": [ "warn", { "newlines-between": "always" } ], "no-case-declarations": "warn", "no-console": "warn", "no-debugger": "warn", "no-else-return": "warn", "no-param-reassign": "warn", "no-undef": "off", "no-unused-vars": "off", "no-var": "warn", "object-shorthand": "warn", "padding-line-between-statements": [ "warn", { "blankLine": "always", "prev": "*", "next": "class" }, { "blankLine": "always", "prev": "*", "next": "for" }, { "blankLine": "always", "prev": "*", "next": "function" }, { "blankLine": "always", "prev": "*", "next": "if" }, { "blankLine": "always", "prev": "*", "next": "return" }, { "blankLine": "always", "prev": "*", "next": "switch" }, { "blankLine": "always", "prev": "*", "next": "try" }, { "blankLine": "always", "prev": "*", "next": "while" }, { "blankLine": "always", "prev": "block-like", "next": ["let", "const"] } ], "prefer-const": "warn", "react/jsx-boolean-value": "warn", "react/jsx-curly-brace-presence": "warn", "react/jsx-key": "warn", "react/jsx-sort-props": [ "warn", { "callbacksLast": true, "reservedFirst": true, "shorthandLast": true } ], "react/no-array-index-key": "warn", "react/prefer-stateless-function": "warn", "react/self-closing-comp": "warn", "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "off", "yoda": "warn" } }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey, I setup my project using above config. But I'm stuck with incorrect header warning. Would you please share your header file
Update[9,Nov 2020]
Hey everyone, those who are having issues with author's above .eslintrc rules you can use mine. Check if it's work for you
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
// force to use airbnb styleguide
"airbnb",
"prettier",
"prettier/@typescript-eslint"
],
"plugins": ["@typescript-eslint", "react-hooks", "header"],
"settings": {
// solves import problems with tsx,ts,jsx,js files
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
},
"react": {
"version": "detect"
}
},
"rules": {
// force to type header comment on each file
"header/header": [2, "config/header.js"], // folder/filename in project directory
"react/jsx-filename-extension": [2, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }],
// solves import problems with tsx,ts,jsx,js files
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/no-angle-bracket-type-assertion": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
// solve React defined problem
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": [
"warn",
{
"functions": false,
"classes": false,
"variables": true
}
],
"import/no-extraneous-dependencies": "warn",
"import/order": [
"warn",
{
"newlines-between": "always"
}
],
"no-case-declarations": "warn",
"no-console": "warn",
"no-debugger": "warn",
"no-else-return": "warn",
"no-param-reassign": "warn",
"no-undef": "off",
"no-unused-vars": "off",
"no-var": "warn",
"object-shorthand": "warn",
"padding-line-between-statements": [
"warn",
{
"blankLine": "always",
"prev": "*",
"next": "class"
},
{
"blankLine": "always",
"prev": "*",
"next": "for"
},
{
"blankLine": "always",
"prev": "*",
"next": "function"
},
{
"blankLine": "always",
"prev": "*",
"next": "if"
},
{
"blankLine": "always",
"prev": "*",
"next": "return"
},
{
"blankLine": "always",
"prev": "*",
"next": "switch"
},
{
"blankLine": "always",
"prev": "*",
"next": "try"
},
{
"blankLine": "always",
"prev": "*",
"next": "while"
},
{
"blankLine": "always",
"prev": "block-like",
"next": ["let", "const"]
}
],
"prefer-const": "warn",
"react/jsx-boolean-value": "warn",
"react/jsx-curly-brace-presence": "warn",
"react/jsx-key": "warn",
"react/jsx-sort-props": [
"warn",
{
"callbacksLast": true,
"reservedFirst": true,
"shorthandLast": true
}
],
"react/no-array-index-key": "warn",
"react/prefer-stateless-function": "warn",
"react/self-closing-comp": "warn",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "off",
"yoda": "warn"
}
}