Skip to content

Commit

Permalink
Format the generated code using prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
meshareL committed Jul 12, 2024
1 parent 2d45c05 commit 379e351
Show file tree
Hide file tree
Showing 12 changed files with 182 additions and 146 deletions.
4 changes: 4 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[browser]
> 0.5%
last 2 versions
Firefox ESR
not ie < 11
not dead

[node]
node >= 18.0
21 changes: 13 additions & 8 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
import pkg from './package.json' assert { type: 'json' };

export default {
browserslistEnv: 'browser',
presets: [
['@babel/preset-env', {
[ '@babel/preset-env', {
// debug: true,
bugfixes: true,
useBuiltIns: false
}],
['@babel/preset-typescript', {
[ '@babel/preset-typescript', {
allowDeclareFields: true,
optimizeConstEnums: true,
onlyRemoveTypeImports: true
}]
],
plugins: [
['@babel/plugin-transform-runtime', {
[ '@babel/plugin-transform-runtime', {
corejs: false,
version: pkg.devDependencies['@babel/runtime']
version: pkg.dependencies['@babel/runtime']
}],
['babel-plugin-polyfill-corejs3', {
[ 'babel-plugin-polyfill-corejs3', {
// debug: true,
exclude: [ 'es.array.push', 'es.array.unshift' ],
// exclude: [ 'es.array.push', 'es.array.unshift' ],
method: 'usage-pure',
version: pkg.devDependencies['core-js-pure'],
version: pkg.dependencies['core-js-pure'],
proposals: true
}]
]
],
overrides: [{
test: 'src/cli/**/*',
browserslistEnv: 'node'
}]
};
8 changes: 4 additions & 4 deletions bin/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node
const { exit } = require('node:process')
, chalk = require('chalk')
, command = require('../dist/cli/command');
import process from 'node:process';
import chalk from 'chalk';
import command from '../dist/cli/command.js';

(async () => {
try {
await command(process.argv);
} catch (e) {
console.log(chalk.red.bold(`j-icon-cli: ${e}`));
exit(1);
process.exit(1);
}
})();
6 changes: 5 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import jslint from '@eslint/js';
import tslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
import globals from 'globals';

export default [
jslint.configs.recommended,
Expand All @@ -19,7 +20,10 @@ export default [
'node_modules/**',
'dist/**',
'test/template/**'
]
],
languageOptions: {
globals: { ...globals.browser, ...globals.nodeBuiltin }
}
},
{
rules: {
Expand Down
Loading

0 comments on commit 379e351

Please sign in to comment.