diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-13 23:17:25 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-13 23:17:25 +0530 |
| commit | 68777ec421d41be0da27013afd4165ae7d658d26 (patch) | |
| tree | 4c1cc6af7acfeac54b2e54372944344d3f5b9a26 /eslint.config.js | |
| parent | 20c3b38f24d79df8843f17985a7d13533d4e0d10 (diff) | |
| download | banglar-bhumi-utils-68777ec421d41be0da27013afd4165ae7d658d26.tar.gz banglar-bhumi-utils-68777ec421d41be0da27013afd4165ae7d658d26.zip | |
refactor: added linting with esling and also resolved warnings for it
Diffstat (limited to 'eslint.config.js')
| -rw-r--r-- | eslint.config.js | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..4f528f4 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,96 @@ +import js from "@eslint/js"; +import stylistic from "@stylistic/eslint-plugin"; +import importX from "eslint-plugin-import-x"; +import globals from "globals"; +import tseslint from "typescript-eslint"; + +export default tseslint.config( + { + ignores: [ + "**/dist/**", + "**/node_modules/**", + "**/*.wasm.js", + "**/static/**" + ] + }, + + js.configs.recommended, + + ...tseslint.configs.strictTypeChecked, + ...tseslint.configs.stylisticTypeChecked, + + stylistic.configs.recommended, + + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.webextensions + }, + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname + } + }, + + plugins: { + "import-x": importX + }, + + rules: { + "@stylistic/indent": ["error", "tab"], + "@stylistic/quotes": ["error", "double"], + "@stylistic/semi": ["error", "always"], + "@stylistic/comma-dangle": ["error", "never"], + "@stylistic/max-len": ["warn", { code: 120, ignoreUrls: true, ignoreStrings: true, ignoreTemplateLiterals: true }], + "@stylistic/arrow-parens": ["error", "always"], + "@stylistic/brace-style": ["error", "1tbs", { allowSingleLine: true }], + "@stylistic/no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1 }], + "@stylistic/no-trailing-spaces": "error", + "@stylistic/eol-last": ["error", "always"], + "@stylistic/no-tabs": "off", + "@stylistic/space-before-function-paren": ["error", "never"], + "@stylistic/member-delimiter-style": ["error", { multiline: { delimiter: "semi", requireLast: false }, singleline: { delimiter: "semi", requireLast: false } }], + + "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_" }], + "@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true, allowTypedFunctionExpressions: true }], + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/prefer-readonly": "warn", + "@typescript-eslint/consistent-type-definitions": ["error", "type"], + "@typescript-eslint/method-signature-style": ["error", "property"], + + "no-console": "warn", + "no-alert": "error", + + "import-x/order": ["error", { + "groups": ["builtin", "external", "internal", ["parent", "sibling"], "index"], + "newlines-between": "always", + "alphabetize": { order: "asc", orderImportKind: "asc" } + }], + "import-x/no-duplicates": "error", + "import-x/first": "error", + "import-x/newline-after-import": "error" + } + }, + + { + files: ["**/*.js"], + ...tseslint.configs.disableTypeChecked + }, + + { + files: ["webpack.config.js", "config/**/*.js"], + languageOptions: { + globals: { + ...globals.node, + ROOT_DIR: "writable", + CONFIG_DIR: "writable", + SOURCE_DIR: "writable", + production: "writable" + } + }, + rules: { + "no-console": "off" + } + } +); |
