Skip to content

chore: add ESLint configuration and fix lint errors #63

Description

@usernane

Problem

No linting configuration exists. Code style is inconsistent and potential bugs (like the wriable typo) go undetected.

Suggestion

Add ESLint with a standard configuration.

Setup

{
  "devDependencies": {
    "eslint": "^8.0.0"
  },
  "scripts": {
    "lint": "eslint AJAXRequest.js",
    "lint:fix": "eslint AJAXRequest.js --fix"
  }
}

Configuration

Create .eslintrc.json with rules appropriate for browser JavaScript:

  • no-undef to catch misspelled variables
  • no-unused-vars to detect dead code
  • consistent-return for functions that sometimes return and sometimes do not
  • eqeqeq to enforce strict equality

Expected Outcome

  • All existing lint errors fixed
  • Lint runs as part of CI pipeline

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions