Skip to content

Commit

Permalink
chore: lint/format .mjs files
Browse files Browse the repository at this point in the history
Fix Prettier issues
  • Loading branch information
matijs committed Mar 27, 2024
1 parent ef4eefd commit 8004954
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"composer.json": "composer validate",
"package.json": "npmPkgJsonLint --allowEmptyTargets",
"*.md": ["markdownlint", "prettier --check"],
"*.{js,cjs,json,jsx,mdx,ts,tsx}": ["eslint --no-error-on-unmatched-pattern", "prettier --check"],
"*.{js,cjs,mjs,json,jsx,mdx,ts,tsx}": ["eslint --no-error-on-unmatched-pattern", "prettier --check"],
"*.{css,scss}": ["stylelint --allow-empty-input", "prettier --check"]
}
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"overrides": [
{
"files": ["*.js", "*.jsx", "*.cjs"],
"files": ["*.js", "*.cjs", "*.mjs", "*.jsx"],
"options": {
"parser": "flow",
"printWidth": 120,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@
"clean": "lerna run clean",
"lint": "npm-run-all --continue-on-error lint:** lint-workspaces",
"lint:css": "stylelint --allow-empty-input '**/*.{css,scss}'",
"lint:js": "eslint --ext .js,.cjs,.json,.jsx,.mdx,.ts,.tsx --report-unused-disable-directives .",
"lint:js": "eslint --ext .js,.cjs,.mjs,.json,.jsx,.mdx,.ts,.tsx --report-unused-disable-directives .",
"lint:md": "markdownlint '**/*.md'",
"lint:package-json": "npmPkgJsonLint '**/package.json'",
"lint:package-lock": "pnpm ls --recursive",
"lint-fix": "npm-run-all --continue-on-error lint-fix:** prettier",
"lint-fix:css": "stylelint --fix '**/*.{css,scss}'",
"lint-fix:js": "eslint --ext .js,.cjs,.json,.jsx,.mdx,.ts,.tsx --fix --report-unused-disable-directives .",
"lint-fix:js": "eslint --ext .js,.cjs,.mjs,.json,.jsx,.mdx,.ts,.tsx --fix --report-unused-disable-directives .",
"lint-fix:md": "markdownlint --fix '**/*.md'",
"lint-workspaces": "lerna run --no-bail lint",
"lint-build": "lerna run --no-bail lint-build",
Expand Down
10 changes: 5 additions & 5 deletions packages/components-react/jest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/* eslint-env node */
import nextJest from "next/jest.js";
import nextJest from 'next/jest.js';

// Next Jest config is great for Jest 27 + React + TypeScript, so let's use that as basis
const createJestConfig = nextJest({
dir: "./",
dir: './',
});

const customJestConfig = {
// Add more setup options before each test is run
// setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
// if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work
moduleDirectories: ["node_modules", "<rootDir>/"],
testEnvironment: "jest-environment-jsdom",
testPathIgnorePatterns: ["/dist/"],
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
testPathIgnorePatterns: ['/dist/'],
// transformIgnorePatterns: ['node_modules/(?!@utrecht/web-component-library-react)'],
};

Expand Down
46 changes: 23 additions & 23 deletions packages/components-react/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
import babel from "@rollup/plugin-babel";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import { readFileSync } from "fs";
import filesize from "rollup-plugin-filesize";
import nodeExternal from "rollup-plugin-node-externals";
import nodePolyfills from "rollup-plugin-node-polyfills";
import postcss from "rollup-plugin-postcss";
import peerDepsExternal from "rollup-plugin-peer-deps-external";
import typescript from "rollup-plugin-typescript2";
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import { readFileSync } from 'fs';
import filesize from 'rollup-plugin-filesize';
import nodeExternal from 'rollup-plugin-node-externals';
import nodePolyfills from 'rollup-plugin-node-polyfills';
import postcss from 'rollup-plugin-postcss';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import typescript from 'rollup-plugin-typescript2';

const packageJson = JSON.parse(readFileSync("./package.json", "utf8"));
const packageJson = JSON.parse(readFileSync('./package.json', 'utf8'));

// rollup.config.js
/**
* @type {import('rollup').RollupOptions}
*/

export const outputGlobals = {
react: "React",
"react-dom": "ReactDOM",
react: 'React',
'react-dom': 'ReactDOM',
};

export default [
{
input: "src/index.ts",
input: 'src/index.ts',
output: [
{
file: packageJson.main,
format: "cjs",
format: 'cjs',
sourcemap: true,
globals: outputGlobals,
},
{
file: packageJson.module,
format: "esm",
format: 'esm',
sourcemap: true,
globals: outputGlobals,
},
],
external: [/@babel\/runtime/, "react-dom", "react"],
external: [/@babel\/runtime/, 'react-dom', 'react'],
plugins: [
peerDepsExternal({ includeDependencies: true }),
nodeExternal(),
Expand All @@ -48,17 +48,17 @@ export default [
}),
nodePolyfills(),
postcss({
extensions: [".css", ".scss"],
extensions: ['.css', '.scss'],
minimize: true,
}),
typescript({ includeDependencies: false }),
babel({
presets: ["@babel/preset-react"],
babelHelpers: "runtime",
exclude: ["node_modules/**", "dist/**"],
extensions: [".ts", ".tsx"],
presets: ['@babel/preset-react'],
babelHelpers: 'runtime',
exclude: ['node_modules/**', 'dist/**'],
extensions: ['.ts', '.tsx'],
inputSourceMap: true,
plugins: ["@babel/plugin-transform-runtime"],
plugins: ['@babel/plugin-transform-runtime'],
}),
filesize(),
],
Expand Down

0 comments on commit 8004954

Please sign in to comment.