Skip to content

Commit

Permalink
move to gts
Browse files Browse the repository at this point in the history
  • Loading branch information
aklkv committed Dec 24, 2024
1 parent 4676b2e commit 26998b4
Show file tree
Hide file tree
Showing 48 changed files with 3,580 additions and 6,939 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
strict-peer-dependents=true
61 changes: 0 additions & 61 deletions .travis.yml

This file was deleted.

9 changes: 0 additions & 9 deletions addon/.eslintignore

This file was deleted.

70 changes: 0 additions & 70 deletions addon/.eslintrc.cjs

This file was deleted.

11 changes: 10 additions & 1 deletion addon/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
'use strict';

module.exports = {
singleQuote: true,
plugins: ['prettier-plugin-ember-template-tag'],
templateSingleQuote: false,
overrides: [
{
files: '*.{js,ts,cjs,mjs,gjs,gts}',
options: {
singleQuote: true,
},
},
],
};
8 changes: 8 additions & 0 deletions addon/babel.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"plugins": [
[
"@babel/plugin-transform-typescript",
{
"allExtensions": true,
"onlyRemoveTypeImports": true,
"allowDeclareFields": true
}
],
"@embroider/addon-dev/template-colocation-plugin",
[
"babel-plugin-ember-template-compilation",
Expand Down
136 changes: 136 additions & 0 deletions addon/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/**
* Debugging:
* https://eslint.org/docs/latest/use/configure/debug
* ----------------------------------------------------
*
* Print a file's calculated configuration
*
* npx eslint --print-config path/to/file.js
*
* Inspecting the config
*
* npx eslint --inspect-config
*
*/
import globals from 'globals';
import js from '@eslint/js';

import ts from 'typescript-eslint';

import ember from 'eslint-plugin-ember/recommended';
import imports from 'eslint-plugin-import';

import prettier from 'eslint-plugin-prettier/recommended';
import n from 'eslint-plugin-n';

import babelParser from '@babel/eslint-parser';

const parserOptions = {
esm: {
js: {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
},
ts: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
};

export default ts.config(
js.configs.recommended,
ember.configs.base,
ember.configs.gjs,
ember.configs.gts,
prettier,
/**
* Ignores must be in their own object
* https://eslint.org/docs/latest/use/configure/ignore
*/
{
ignores: ['dist/', 'declarations/', 'node_modules/', 'coverage/', '!**/.*'],
},
/**
* https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
*/
{
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
},
{
files: ['**/*.js'],
languageOptions: {
parser: babelParser,
},
},
{
files: ['**/*.{js,gjs}'],
languageOptions: {
parserOptions: parserOptions.esm.js,
globals: {
...globals.browser,
},
},
},
{
files: ['**/*.ts'],
languageOptions: {
parserOptions: parserOptions.esm.ts,
},
extends: [ember.configs.base, ...ts.configs.recommendedTypeChecked],
},
{
files: ['**/*.gts'],
languageOptions: {
parser: ember.parser,
parserOptions: parserOptions.esm.ts,
},
extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
},
{
files: ['**/*.{js,gjs,ts,gts}'],
plugins: {
import: imports,
},
rules: {
'import/extensions': ['error', 'always', { ignorePackages: true }],
},
},
/**
* CJS node files
*/
{
files: ['**/*.cjs'],
plugins: {
n,
},

languageOptions: {
sourceType: 'script',
ecmaVersion: 'latest',
globals: {
...globals.node,
},
},
},
/**
* ESM node files
*/
{
files: ['**/*.mjs'],
plugins: {
n,
},

languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parserOptions: parserOptions.esm.js,
globals: {
...globals.node,
},
},
},
);
Loading

0 comments on commit 26998b4

Please sign in to comment.