Skip to content

Commit

Permalink
create and enforce linting on commit and push
Browse files Browse the repository at this point in the history
Signed-off-by: Enock Kasaadha <[email protected]>
  • Loading branch information
kaxada committed Nov 11, 2024
1 parent 9b2609c commit e49918b
Show file tree
Hide file tree
Showing 6 changed files with 554 additions and 483 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run format
37 changes: 37 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Linter } from "eslint";
import prettierConfig from "eslint-plugin-prettier";
import importPlugin from "eslint-plugin-import";

const eslintRecommended = new Linter().getRules();

export default [
{
files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
ignores: ["node_modules", "build", "package*.json"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
es6: true,
node: true,
browser: true,
},
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
plugins: {
prettier: prettierConfig,
import: importPlugin,
},
rules: {
...eslintRecommended,
"prettier/prettier": ["error", prettierConfig.rules],
"import/no-unresolved": ["error"],
},
},
];
Loading

0 comments on commit e49918b

Please sign in to comment.