Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix linting #168

Merged
merged 1 commit into from
Oct 8, 2023
Merged

fix linting #168

merged 1 commit into from
Oct 8, 2023

Conversation

Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Oct 8, 2023

Checklist

Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but index.js is also in the prettier script, is that intentional?

Copy link
Member

@Eomm Eomm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will die without seeing prettier and eslint working fine together on the first try.

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Oct 8, 2023

If it would me, I would just rip out prettier and eslint and just use standard. but then people would complain that typescript files are not linted. So I just do this minimal patch, to get the CI green.

@gurgunday
index.js contains code. Is it wrong?

@gurgunday
Copy link
Member

Yeah but I thought eslint was using standard for .js files

@gurgunday
Copy link
Member

gurgunday commented Oct 8, 2023

@Eomm I'm really proud of this config that uses standard for everything except formatting, which prettier takes care of 😁

{
  "root": true,
  "extends": ["standard", "prettier"],
  "plugins": ["github", "prettier"],
  "rules": {
    "no-restricted-syntax": [
      "error",
      "MethodDefinition[kind='get']",
      "MethodDefinition[kind='set']",
      "VariableDeclaration[kind='var']",
      "WithStatement"
    ],
    "github/array-foreach": "error",
    "class-methods-use-this": "error",
    "prefer-const": "error",
    "prefer-destructuring": "error",
    "prefer-exponentiation-operator": "error",
    "prefer-named-capture-group": "error",
    "prefer-numeric-literals": "error",
    "prefer-object-has-own": "error",
    "prefer-object-spread": "error",
    "prefer-promise-reject-errors": "error",
    "prefer-regex-literals": "error",
    "prefer-rest-params": "error",
    "prefer-spread": "error",
    "prefer-template": "error",
    "prettier/prettier": "error",
    "arrow-body-style": "error",
    "curly": ["error", "all"],
    "quotes": ["error", "double", { "avoidEscape": true }]
  }
}

@Eomm Eomm merged commit 9048df4 into master Oct 8, 2023
17 checks passed
@Eomm Eomm deleted the fix-linting branch October 8, 2023 14:32
@Fdawgs
Copy link
Member

Fdawgs commented Oct 8, 2023

I'm really proud of this config that uses standard for everything except formatting, which prettier takes care of 😁

https://github.com/prettier/eslint-config-prettier ?

@Eomm
Copy link
Member

Eomm commented Oct 8, 2023

Here is my setup standard + typescript:

"lint:typescript": "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin *.ts test/**/*.ts",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants