Skip to content

Commit

Permalink
fix: add parser option for cjs,mjs,cts,mts (#49)
Browse files Browse the repository at this point in the history
Co-authored-by: Haoqun Jiang <[email protected]>
  • Loading branch information
kingyue737 and haoqunjiang authored Sep 13, 2023
1 parent a419fd4 commit a06fe4c
Showing 1 changed file with 5 additions and 1 deletion.
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', '*.cts', '*.mts', '*.tsx', '*.vue'],
rules: {
// The core 'no-unused-vars' rules (in the eslint:recommeded ruleset)
// does not work with type definitions
Expand Down

0 comments on commit a06fe4c

Please sign in to comment.