Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

37 changes: 0 additions & 37 deletions .eslintrc.js

This file was deleted.

85 changes: 85 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
process.env.ENABLE_NEW_JSX_TRANSFORM = 'true';

const globals = require('globals');
const mcAppConfig = require('@commercetools-frontend/eslint-config-mc-app');

module.exports = [
// Ignores replace .eslintignore (directory patterns end with /)
{
ignores: [
'dist/',
'**/dist/',
'proxy_exports/**/*.js',
'node_modules/*',
'**/node_modules/*',
'vendors/*',
'**/raw-components',
'generators/**',
],
},

// Spread the base config (replaces "extends")
...mcAppConfig,

// testing-library overrides for spec/test files
{
files: ['**/*.{spec,test}.{js,jsx,ts,tsx}'],
rules: {
'testing-library/no-node-access': 'off',
'testing-library/no-container': 'off',
},
},

// testing-library overrides for test utility files
{
files: [
'**/test-utils/**/*.{jsx,tsx}',
'**/*test-utils.{jsx,tsx}',
'**/*test-helpers.{jsx,tsx}',
],
rules: {
'testing-library/no-node-access': 'off',
'testing-library/no-container': 'off',
},
},

// React display-name override for visual routes and docs
// (react plugin is registered for *.js, *.jsx, *.tsx)
{
files: ['**/*.visualroute.js', '**/docs/*.js'],
rules: {
'react/display-name': 'off',
},
},

// Globals for visual spec files
{
files: ['**/*.visualspec.js'],
languageOptions: {
globals: {
...globals.jest,
page: 'readonly',
HOST: 'readonly',
globalThis: 'readonly',
},
},
},

// Bundle spec files use jest globals but don't match *.{spec,test}.js pattern
{
files: ['**/*.bundlespec.js'],
languageOptions: {
globals: {
...globals.jest,
},
},
},

// Version files — allow anonymous default exports
{
files: ['**/version.js', '**/version.ts'],
rules: {
'import/no-anonymous-default-export': 'off',
},
},
];
9 changes: 1 addition & 8 deletions jest-runner-eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
module.exports = {
cliOptions: {
format: 'stylish',
rules: {
'import/no-unresolved': 2,
'prettier/prettier': [
'error',
{ trailingComma: 'es5', singleQuote: true },
],
},
format: 'eslint-formatter-pretty',
},
};
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
"@babel/core": "7.28.4",
"@changesets/changelog-github": "0.5.1",
"@changesets/cli": "2.29.7",
"@commercetools-frontend/babel-preset-mc-app": "24.8.0",
"@commercetools-frontend/eslint-config-mc-app": "24.8.0",
"@commercetools-frontend/babel-preset-mc-app": "27.0.0",
"@commercetools-frontend/eslint-config-mc-app": "27.0.0",
"@commercetools-local/generator-package-json": "*",
"@commercetools-local/generator-readme": "*",
"@commitlint/cli": "20.1.0",
Expand Down Expand Up @@ -140,7 +140,7 @@
"commander": "^13.1.0",
"conventional-changelog-cli": "5.0.0",
"cross-env": "10.1.0",
"eslint": "8.57.1",
"eslint": "^9.0.0",
"eslint-formatter-pretty": "7.0.0",
"execa": "9.6.0",
"formik": "^2.4.6",
Expand Down
2 changes: 0 additions & 2 deletions test/setup-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ global.window.app = {

if (global.document) {
document.createRange = () => ({
// eslint-disable-next-line @typescript-eslint/no-empty-function
setStart: () => {},
// eslint-disable-next-line @typescript-eslint/no-empty-function
setEnd: () => {},
commonAncestorContainer: {
nodeName: 'BODY',
Expand Down
Loading
Loading