Skip to content

Commit

Permalink
change compilation process
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Ezequiel Fabbroni Assum committed Jan 3, 2025
1 parent cdc48c8 commit c99bb7f
Show file tree
Hide file tree
Showing 15 changed files with 216 additions and 81,995 deletions.
13 changes: 9 additions & 4 deletions configs/base.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable import/extensions */
import eslintConfigPrettier from 'eslint-config-prettier';
import globals from 'globals';

import bestPractices from './best-practices.js';
Expand Down Expand Up @@ -37,22 +38,23 @@ const configs = [
errors,
es6,
...imports,
postcss,
node,
promises,
strict,
style,
variables,
react,
lodash,
reactA11y,
formats,
storybook,
postcss,
lodash,

isJestAvailable && jest,
].filter(Boolean);

export default [
const rules = [
...configs,
{},
{
name: 'base-cabify-eslint-config',
languageOptions: {
Expand All @@ -68,4 +70,7 @@ export default [
},
},
...tsConfigs,
eslintConfigPrettier,
];

export default rules;
4 changes: 3 additions & 1 deletion configs/ts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/no-unresolved */
/* eslint-disable no-param-reassign */

import path from 'path';
import tseslint from 'typescript-eslint';

Expand Down Expand Up @@ -154,7 +154,9 @@ const tsLintConfig = tseslint.config(

if (tsLintConfig.length) {
tsLintConfig.forEach((tsconfig) => {
// eslint-disable-next-line no-param-reassign
tsconfig.files = ['**/*.ts', '**/*.tsx'];
// eslint-disable-next-line no-param-reassign
tsconfig.ignores = ['**/*.d.ts'];
});
}
Expand Down
216 changes: 0 additions & 216 deletions dist/eslint.config-XHzFxT-b.cjs

This file was deleted.

81,566 changes: 0 additions & 81,566 deletions dist/eslint.config-c2LFEVEx.js

This file was deleted.

188 changes: 188 additions & 0 deletions dist/eslint.config-pxQk0ZEe.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./eslint.config-XHzFxT-b.cjs");exports.default=e.eslint_config;
"use strict";const e=require("./eslint.config-pxQk0ZEe.cjs");module.exports=e.eslint_config;
4 changes: 0 additions & 4 deletions dist/eslint.config.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/ts-B06eACnL.cjs

This file was deleted.

1 change: 1 addition & 0 deletions dist/ts-tx5aZNua.cjs

Large diffs are not rendered by default.

166 changes: 0 additions & 166 deletions dist/ts-wJBM66KR.js

This file was deleted.

7 changes: 3 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// eslint-disable-next-line import/extensions
import recommended from './recommended.js';
import defaultRules from './configs/base.js';

const globalIgnores = {
ignores: ['dist', 'node_modules/*', 'build', 'scripts'],
ignores: ['dist', 'node_modules/*', 'build', 'scripts', 'vite.config.js'],
};

export default [...recommended, globalIgnores];
export default [...defaultRules, globalIgnores];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"main": "../recommended.js",
"exports": {
"require": "./dist/eslint.config.cjs",
"import": "./.dist/eslint.config.js"
"import": "./eslint.config.js"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^8.15.0",
Expand Down
6 changes: 0 additions & 6 deletions recommended.js

This file was deleted.

11 changes: 0 additions & 11 deletions utils.js

This file was deleted.

24 changes: 10 additions & 14 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from 'vite';

export default defineConfig({
build: {
lib: {
entry: './eslint.config.js', // Your entry file
name: '@cabify/eslint-config', // Global variable name (for UMD/IIFE)
formats: ['es', 'cjs'], // Output both ESM and CommonJS
fileName: (format) =>
format === 'es' ? 'eslint.config.js' : 'eslint.config.cjs', // Explicit output filenames
entry: './eslint.config.js',
name: '@cabify/eslint-config',
formats: ['cjs'],
fileName: () => `eslint.config.cjs`,
},
optimizeDeps: {
esbuildOptions: {
Expand All @@ -22,14 +20,12 @@ export default defineConfig({
external: [
'eslint',
'eslint-plugin-import',
'eslint-plugin',
'typescript-eslint',
], // Treat ESLint as an external package
output: {
// Customize output if needed
exports: 'named', // Ensures named exports in CommonJS
},
'@typescript-eslint/parser',
'@typescript-eslint/eslint-plugin',
'eslint-plugin-prettier/recommended',
'eslint-plugin-lodash',
'eslint-plugin-jest',
],
},
target: 'esnext', // browsers can handle the latest ES features
},
});

0 comments on commit c99bb7f

Please sign in to comment.