diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 00000000..90c5dc86 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,34 @@ +name: ESLint Linting + +on: + pull_request: + paths: + - '**/*.js' + - '**/*.jsx' + - '**/*.ts' + - '**/*.tsx' + - '.eslintrc*' + - 'package.json' + - 'yarn.lock' + - 'pnpm-lock.yaml' + - 'package-lock.json' + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: | + npm ci + + - name: Run ESLint + run: | + npx eslint . --ext .js,.jsx,.ts,.tsx \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js index 32a7f598..dfc194bc 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,12 +1,19 @@ import tseslint from 'typescript-eslint'; -export default tseslint.config( - tseslint.configs.recommended, - { - files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"], - rules: { - semi: "error", - "prefer-const": "error" - } +export default tseslint.config({ + files: ["**/*.{ts,tsx,js,jsx}"], + languageOptions: { + parser: tseslint.parser, + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + ecmaFeatures: { + jsx: true + } } -); + }, + rules: { + "semi": "error", + "prefer-const": "warn" + } +}); \ No newline at end of file