-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
822593a
commit 14e16b6
Showing
5 changed files
with
3,412 additions
and
917 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
description: 'Generates a changeset validator', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,132 @@ | ||
// eslint.config.mjs | ||
/** | ||
* 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 { FlatCompat } from '@eslint/eslintrc'; | ||
import emberPlugin from 'eslint-plugin-ember'; | ||
import prettierPlugin from 'eslint-plugin-prettier'; | ||
import js from '@eslint/js'; // Import ESLint core configs | ||
import globals from 'globals'; // Import globals | ||
import ember from 'eslint-plugin-ember/recommended'; | ||
import prettier from 'eslint-plugin-prettier/recommended'; | ||
import qunit from 'eslint-plugin-qunit'; | ||
import n from 'eslint-plugin-n'; | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: import.meta.url, | ||
resolvePluginsRelativeTo: import.meta.url, | ||
recommendedConfig: js.configs.recommended, // Provide recommendedConfig | ||
}); | ||
import babelParser from '@babel/eslint-parser'; | ||
|
||
const esmParserOptions = { | ||
ecmaFeatures: { modules: true }, | ||
ecmaVersion: 'latest', | ||
requireConfigFile: false, | ||
babelOptions: { | ||
plugins: [ | ||
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }], | ||
], | ||
}, | ||
}; | ||
|
||
export default [ | ||
js.configs.recommended, | ||
prettier, | ||
ember.configs.base, | ||
ember.configs.gjs, | ||
/** | ||
* Ignores must be in their own object | ||
* https://eslint.org/docs/latest/use/configure/ignore | ||
*/ | ||
{ | ||
ignores: [ | ||
'blueprints/validator/files', | ||
'dist/', | ||
'node_modules/', | ||
'coverage/', | ||
'!**/.*', | ||
], | ||
}, | ||
/** | ||
* https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options | ||
*/ | ||
{ | ||
linterOptions: { | ||
reportUnusedDisableDirectives: 'error', | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.js'], | ||
languageOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', // Ensure ES module parsing | ||
parser: babelParser, | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.{js,gjs}'], | ||
languageOptions: { | ||
parserOptions: esmParserOptions, | ||
globals: { | ||
...globals.browser, | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['tests/**/*-test.{js,gjs}'], | ||
plugins: { | ||
ember: emberPlugin, | ||
prettier: prettierPlugin, | ||
qunit, | ||
}, | ||
rules: {}, | ||
}, | ||
// Extend configurations using FlatCompat | ||
...compat.extends( | ||
'eslint:recommended', | ||
'plugin:ember/recommended', | ||
'plugin:prettier/recommended', | ||
), | ||
/** | ||
* CJS node files | ||
*/ | ||
{ | ||
ignores: [ | ||
'node_modules/', | ||
'dist/', | ||
'blueprints', | ||
'.prettierrc.cjs', | ||
'.template-lintrc.js', | ||
'config/ember-try.js', | ||
'ember-cli-build.js', | ||
files: [ | ||
'**/*.cjs', | ||
'blueprints/**/*.js', | ||
'config/**/*.js', | ||
'tests/dummy/config/**/*.js', | ||
'node-test/**/*.js', | ||
'index.js', | ||
'node-test/', | ||
'config/environment.js', | ||
'tests/dummy/', | ||
'testem.js', | ||
'testem*.js', | ||
'.prettierrc.js', | ||
'.stylelintrc.js', | ||
'.template-lintrc.js', | ||
'ember-cli-build.js', | ||
], | ||
plugins: { | ||
n, | ||
}, | ||
|
||
languageOptions: { | ||
sourceType: 'script', | ||
ecmaVersion: 'latest', | ||
globals: { | ||
...globals.mocha, | ||
...globals.node, | ||
}, | ||
}, | ||
}, | ||
/** | ||
* ESM node files | ||
*/ | ||
{ | ||
files: ['**/*.mjs'], | ||
plugins: { | ||
n, | ||
}, | ||
|
||
languageOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 'latest', | ||
parserOptions: esmParserOptions, | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
}, | ||
]; |
Oops, something went wrong.