Browse Source

Use `@solana/eslint-config-solana` preset

With a handful of rules turned off for now as the generated code doesn't comply with them.
Loris Leiva 1 year ago
parent
commit
585e59ea1f

+ 6 - 19
template/clients/js/clients/js/_.eslintrc.cjs

@@ -1,24 +1,11 @@
 module.exports = {
-  extends: ['airbnb-base', 'airbnb-typescript/base', 'prettier'],
-  plugins: ['prettier'],
-  overrides: [],
-  parserOptions: {
-    ecmaVersion: 'latest',
-    sourceType: 'module',
-    project: 'tsconfig.json',
-    tsconfigRootDir: __dirname,
-  },
+  extends: ['@solana/eslint-config-solana'],
   rules: {
-    '@typescript-eslint/no-use-before-define': 'off',
-    '@typescript-eslint/no-unused-vars': 'off',
-    'class-methods-use-this': 'off',
-    'import/prefer-default-export': 'off',
-    'import/no-cycle': 'off',
-    'no-underscore-dangle': 'off',
-    'max-classes-per-file': 'off',
-    'no-param-reassign': 'off',
-    'func-names': 'off',
+    '@typescript-eslint/ban-types': 'off',
+    '@typescript-eslint/sort-type-constituents': 'off',
     'prefer-destructuring': 'off',
+    'simple-import-sort/imports': 'off',
+    'sort-keys-fix/sort-keys-fix': 'off',
+    'typescript-sort-keys/interface': 'off',
   },
-  ignorePatterns: ['dist/**', '.eslintrc.cjs', 'tsup.config.ts', 'env-shim.ts'],
 };

+ 1 - 4
template/clients/js/clients/js/package.json.njk

@@ -42,16 +42,13 @@
   },
   "devDependencies": {
     "@ava/typescript": "^4.1.0",
+    "@solana/eslint-config-solana": "^3.0.0",
     "@solana/web3.js": "^2.0.0-preview",
     "@solana/webcrypto-ed25519-polyfill": "^2.0.0-preview",
     "@typescript-eslint/eslint-plugin": "^7.3.1",
     "@typescript-eslint/parser": "^7.3.1",
     "ava": "^6.1.2",
     "eslint": "^8.57.0",
-    "eslint-config-airbnb-typescript": "^18.0.0",
-    "eslint-config-prettier": "^9.1.0",
-    "eslint-plugin-import": "^2.29.0",
-    "eslint-plugin-prettier": "^5.1.3",
     "prettier": "^3.2.5",
     "rimraf": "^5.0.5",
     "tsup": "^8.0.2",

File diff suppressed because it is too large
+ 180 - 610
template/clients/js/clients/js/pnpm-lock.yaml


Some files were not shown because too many files changed in this diff