THRIFT-5811: Update eslint & prettier
Client: js
Patch: Cameron Martin
This closes #3087
diff --git a/eslint.config.mjs b/eslint.config.mjs
new file mode 100644
index 0000000..a27b211
--- /dev/null
+++ b/eslint.config.mjs
@@ -0,0 +1,44 @@
+import globals from "globals";
+import js from "@eslint/js";
+import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
+
+export default [
+ {
+ ignores: [
+ // TODO: Use eslint on js lib and generated code
+
+ // Ignore lib/js for now, which uses jshint currently
+ "lib/js/*",
+ // Ignore all generated code for now
+ "**/gen-*/",
+
+ // Don't lint nested node_modules
+ "**/node_modules/",
+ ],
+ },
+ js.configs.recommended,
+ eslintPluginPrettierRecommended,
+ {
+ languageOptions: {
+ globals: {
+ ...globals.node,
+ },
+
+ ecmaVersion: 2017,
+ sourceType: "commonjs",
+ },
+
+ rules: {
+ "no-console": "off",
+ "no-var": "error",
+ "prefer-const": "error",
+
+ "no-constant-condition": [
+ "error",
+ {
+ checkLoops: false,
+ },
+ ],
+ },
+ },
+];