@gspothq/eslint-plugin
ESLint rules for code that AI coding agents often write.
The plugin reports:
- Files that only forward to another module, functions of a few statements, and exports that only rename a value.
- Relative imports that leave a boundary folder.
- Logic bugs in comparisons, loops, returns, and regular expressions.
- Mistakes in tests and assertions for Jest, Vitest, Bun, Mocha, Jasmine, chai, Playwright, and Cypress.
- Wrong or outdated use of React, Vue, lodash, jQuery, and Axios.
- Accessibility problems in JSX tables and
<object>elements. - Security problems in web servers, cookies, cryptography, and cloud stacks.
The gspot CLI sets up this plugin. Install the plugin yourself only when you run ESLint without gspot.
Install
Section titled “Install”Requires Node.js >=22.22.3 and ESLint >=10.13.0. The optional magic-numbers rule needs @typescript-eslint/eslint-plugin ^8.71.0.
| Package manager | Command |
|---|---|
| Bun | bun add --dev @gspothq/eslint-plugin eslint |
| npm | npm install --save-dev @gspothq/eslint-plugin eslint |
| pnpm | pnpm add --save-dev @gspothq/eslint-plugin eslint |
| Yarn | yarn add --dev @gspothq/eslint-plugin eslint |
The recommended config turns on 141 rules. The all config turns on every lint rule except gspot/no-magic-numbers, gspot/no-unvalidated-json-body, and gspot/require-server-only.
Add the recommended or all config to eslint.config.mjs:
import gspot from '@gspothq/eslint-plugin';
export default [gspot.configs.all];TypeScript
Section titled “TypeScript”Install @typescript-eslint/parser with the TypeScript version it supports, then select your TypeScript files.
projectService gives the rules that read types their type information:
import gspot from '@gspothq/eslint-plugin';import tsParser from '@typescript-eslint/parser';
export default [ { ...gspot.configs.all, files: ['**/*.ts', '**/*.tsx'], languageOptions: { parser: tsParser, parserOptions: { projectService: true } }, },];no-constant-assertionsno-cypress-then-assertionsno-incomplete-assertionsno-inverted-assertionsno-mismatched-assertion-typesno-misplaced-assertionsno-self-comparing-assertionsno-uncertain-chai-assertionsprefer-matcher-assertionsrequire-error-checksrequire-test-assertionsvalid-throw-assertions
aws-apigateway-public-apiaws-efs-unencryptedaws-iam-all-privilegesaws-iam-privilege-escalationaws-iam-public-accessaws-insecure-bucket-transportaws-open-admin-portsaws-opensearchservice-domainaws-public-bucket-grantsaws-public-instancesaws-rds-unencrypted-databasesaws-s3-bucket-versioningaws-sns-unencrypted-topicsaws-sqs-unencrypted-queueaws-unblocked-public-bucketsaws-unencrypted-notebooksaws-unencrypted-volumes
no-element-overwriteno-empty-collectionno-in-misuseno-positive-index-checkno-unused-collectionno-void-array-callbackrequire-reduce-initial-value
max-switch-casesno-compound-caseno-duplicated-branchesno-equal-loop-conditionno-ignored-catchno-misplaced-loop-counterno-nested-switchno-small-switchno-switch-case-labelsno-unthrown-errorno-updated-loop-counter
encryption-secure-modehardcoded-secret-signaturesinsecure-jwt-tokenno-insecure-randomno-weak-cipherno-weak-hashingno-weak-keysreview-blockchain-mnemonic
no-boolean-parametersno-empty-return-valueno-excess-call-argumentsno-identical-functionsno-ignored-returnno-inconsistent-function-callno-invariant-returnsno-mixed-return-typesno-nested-functionsno-selector-parameterno-swapped-argumentsno-trivial-functionsno-undefined-argument
no-adjacent-multiline-ifno-detached-callno-nested-template-literalsno-transposed-assignmentno-unenclosed-multiline-block
no-bitwise-in-conditionno-floating-point-equalityno-gratuitous-expressionsno-identical-operandsno-negated-comparisonno-redundant-boolean
no-component-debounceno-generated-keysno-leaked-jsx-numberno-self-state-updateno-setter-in-componentprefer-readonly-props
max-regex-complexityno-ambiguous-anchorsno-empty-repetitionno-lazy-before-optionalno-stateful-regexno-string-regex-patternno-unknown-regex-group
disabled-auto-escapingdynamic-templatesno-code-evalno-dynamic-sql-queriesno-path-commandno-public-file-permissionsno-public-temporary-pathxml-parser-xxe
max-request-sizeno-any-origin-policyno-powered-by-headerno-production-debugno-unchecked-request-datano-unsafe-file-uploadsno-unsafe-security-headersno-unvalidated-json-bodyrequire-csrf-middlewarerequire-session-regenerationstatic-before-session
import-boundariesno-index-importsno-renamed-exportsno-renamed-importsno-trivial-filesrestricted-syntax
no-async-suite-callbacksno-code-after-doneno-duplicate-test-rowsno-duplicate-test-titlesno-early-test-returnno-empty-test-fileno-empty-test-tableno-empty-test-titlesno-exclusive-testsno-fixed-test-waitsno-forced-ui-actionsno-nested-vitest-mockno-overflowing-test-timeoutno-test-retriesno-ui-test-debuggingno-unexplained-test-skipsprefer-test-tabletest-hooks-firsttesting-library-queries
no-redundant-optionalno-useless-intersectionprefer-readonly-staticprefer-type-aliasprefer-type-guardredundant-type-aliases
no-default-utility-importsno-shallow-clone-mutationprefer-native-axiosprefer-native-jqueryprefer-native-lodashrequire-memoize-key