Skip to content

Commit

Permalink
Use custom parser for gts/gjs (#1920)
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Aug 21, 2023
1 parent 1b172a6 commit 9bd5ee4
Show file tree
Hide file tree
Showing 13 changed files with 982 additions and 1,068 deletions.
12 changes: 6 additions & 6 deletions lib/config/recommended.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const rules = require('../recommended-rules');
const util = require('ember-template-imports/src/util');

module.exports = {
root: true,
Expand Down Expand Up @@ -29,11 +28,12 @@ module.exports = {
* on -- and isn't relevant to user-land code.
*/
{
files: ['**/*.gjs', '**/*.gts'],
processor: 'ember/<template>',
globals: {
[util.TEMPLATE_TAG_PLACEHOLDER]: 'readonly',
},
files: ['**/*.gts'],
parser: require.resolve('../parsers/gts-parser'),
},
{
files: ['**/*.gjs'],
parser: require.resolve('../parsers/gjs-parser'),
},
],
};
8 changes: 0 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@

const requireIndex = require('requireindex');

const gjs = require('./preprocessors/glimmer');

module.exports = {
rules: requireIndex(`${__dirname}/rules`),
configs: requireIndex(`${__dirname}/config`),
utils: {
ember: require('./utils/ember'),
},
processors: {
// https://eslint.org/docs/developer-guide/working-with-plugins#file-extension-named-processor
'.gjs': gjs,
'.gts': gjs,
'<template>': gjs,
},
};

0 comments on commit 9bd5ee4

Please sign in to comment.