Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add parser option for cjs,mjs,cts,mts #49

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ module.exports = {
parser: {
'js': 'espree',
'jsx': 'espree',
'cjs': 'espree',
'mjs': 'espree',

'ts': require.resolve('@typescript-eslint/parser'),
'tsx': require.resolve('@typescript-eslint/parser'),
'cts': require.resolve('@typescript-eslint/parser'),
'mts': require.resolve('@typescript-eslint/parser'),

// Leave the template parser unspecified, so that it could be determined by `<script lang="...">`
},
Expand All @@ -27,7 +31,7 @@ module.exports = {

overrides: [
{
files: ['*.ts', '*.tsx', '*.vue'],
files: ['*.ts', '*.mts', '*.tsx', '*.vue'],
rules: {
// The core 'no-unused-vars' rules (in the eslint:recommeded ruleset)
// does not work with type definitions
Expand Down