Skip to content
Draft
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.

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

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

module.exports = [
// Global ignores (replaces .eslintignore)
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/.cache/**',
'**/build/**',
],
},

// Base config from mc-app-flat
...mcAppConfig,

// Custom rules for ui-kit
{
rules: {
'testing-library/no-node-access': 'off',
'testing-library/no-container': 'off',
},
},

// Overrides for specific file patterns
{
files: ['*.bundlespec.js', '**/*.bundlespec.js'],
languageOptions: {
globals: {
...globals.jest,
},
},
},
{
files: ['*.visualroute.js', '**/docs/*.js'],
rules: {
'react/display-name': 'off',
},
},
{
files: ['*.visualspec.js', '**/*.visualspec.js'],
languageOptions: {
globals: {
...globals.jest,
page: true,
HOST: true,
globalThis: true,
},
},
},
{
files: ['version.js', 'version.ts'],
rules: {
'import/no-anonymous-default-export': 'off',
},
},
{
files: ['**/test/fixtures/**/*.js'],
rules: {
'import/no-unresolved': 'off',
'react/no-unused-prop-types': 'off',
},
},
];
6 changes: 3 additions & 3 deletions generators/package-json/bin/generate-package-json.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';

import type { CommandFlags } from '../src/types';
import { program } from 'commander';
import { generate } from '../src/index';

process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';

program
.name('generate-package-json')
.argument(
Expand Down
6 changes: 3 additions & 3 deletions generators/readme/bin/generate-readme.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';

import type { CommandFlags } from '../src/types';
import { program } from 'commander';
import { generate } from '../src/index';

process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';

program
.name('generate-readme')
.argument(
Expand Down
10 changes: 5 additions & 5 deletions generators/readme/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function existPath(filePath: string) {
try {
await fs.promises.access(filePath);
return true;
} catch (error) {
} catch {
return false;
}
}
Expand All @@ -82,6 +82,10 @@ const heading = (depth: Heading['depth'], value: string): Heading => ({
depth,
children: [text(value)],
});
const inlineCode = (value: string): InlineCode => ({
type: 'inlineCode',
value,
});
const headingSignature = (
depth: Heading['depth'],
value: string,
Expand All @@ -101,10 +105,6 @@ const code = (lang: string, value: string): Code => ({
lang,
value,
});
const inlineCode = (value: string): InlineCode => ({
type: 'inlineCode',
value,
});
const table = (
tableHeader: TableRow,
tableBody: TableRow[],
Expand Down
2 changes: 1 addition & 1 deletion jest-runner-eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
cliOptions: {
format: 'stylish',
format: 'eslint-formatter-pretty',
rules: {
'import/no-unresolved': 2,
'prettier/prettier': [
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"@typescript-eslint/parser": "8.46.0",
"axios": "^1.9.0",
"core-js-compat": "^3.23.4",
"eslint-plugin-react-hooks": "6.1.1",
"glob-parent": "^6.0.0",
"minimatch": "^10.1.0",
"json5": "^2.0.0",
Expand All @@ -103,7 +104,7 @@
"@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/eslint-config-mc-app-flat": "file:./vendor/commercetools-frontend-eslint-config-mc-app-flat-25.1.0-f06f48581.tgz",
"@commercetools-local/generator-package-json": "*",
"@commercetools-local/generator-readme": "*",
"@commitlint/cli": "20.1.0",
Expand Down Expand Up @@ -139,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
1 change: 0 additions & 1 deletion packages/utils/src/warning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ export const warning: TWarningFunction = (
export const useWarning = (condition: boolean, message: string) => {
useEffect(() => {
warning(condition, message);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
};
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
Binary file not shown.
Loading
Loading