diff --git a/.eslintignore b/.eslintignore index 0c17e6907e..1ab6f8d8c4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,4 +5,4 @@ /tmp/** /coverage/** /custom/** -!.eslintrc.js +!.eslintrc.cjs diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 99% rename from .eslintrc.js rename to .eslintrc.cjs index 7cefd7347b..6b562e5bf3 100644 Binary files a/.eslintrc.js and b/.eslintrc.cjs differ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f124eb5055..ab2fb497d8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,10 +48,12 @@ lint-js: changes: - "**/*.js" - "**/*.jsx" + - "**/*.cjs" + - "**/*.mjs" - "**/*.ts" - "**/*.tsx" - ".eslintignore" - - ".eslintrc.js" + - ".eslintrc.cjs" lint-sass: stage: test @@ -72,7 +74,7 @@ jest: - "app/soapbox/**/*" - "webpack/**/*" - "custom/**/*" - - "jest.config.js" + - "jest.config.cjs" - "package.json" - "yarn.lock" - ".gitlab-ci.yml" diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 5dcd5926ae..97bad7f287 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,5 +1,8 @@ { "*.js": "eslint --cache", + "*.cjs": "eslint --cache", + "*.mjs": "eslint --cache", "*.ts": "eslint --cache", + "*.tsx": "eslint --cache", "app/styles/**/*.scss": "stylelint" } diff --git a/babel.config.js b/babel.config.cjs similarity index 100% rename from babel.config.js rename to babel.config.cjs diff --git a/jest.config.js b/jest.config.cjs similarity index 92% rename from jest.config.js rename to jest.config.cjs index 0974fb6217..300e2c3bae 100644 Binary files a/jest.config.js and b/jest.config.cjs differ diff --git a/jest/assetTransformer.js b/jest/assetTransformer.cjs similarity index 100% rename from jest/assetTransformer.js rename to jest/assetTransformer.cjs diff --git a/package.json b/package.json index 079c07389e..9230aa400e 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "test:coverage": "${npm_execpath} run test --coverage", "test:all": "${npm_execpath} run test:coverage && ${npm_execpath} run lint", "lint": "${npm_execpath} run lint:js && ${npm_execpath} run lint:sass", - "lint:js": "npx eslint --ext .js,.jsx,.ts,.tsx . --cache", + "lint:js": "npx eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx . --cache", "lint:sass": "npx stylelint app/styles/**/*.scss", "prepare": "husky install" }, diff --git a/postcss.config.js b/postcss.config.cjs similarity index 100% rename from postcss.config.js rename to postcss.config.cjs diff --git a/tailwind.config.js b/tailwind.config.cjs similarity index 98% rename from tailwind.config.js rename to tailwind.config.cjs index 2f7b72fb2e..d5c9d5f068 100644 Binary files a/tailwind.config.js and b/tailwind.config.cjs differ diff --git a/tailwind/__tests__/colors-test.js b/tailwind/__tests__/colors-test.js index 36bc2526c8..db5695e39a 100644 Binary files a/tailwind/__tests__/colors-test.js and b/tailwind/__tests__/colors-test.js differ diff --git a/tailwind/colors.js b/tailwind/colors.cjs similarity index 100% rename from tailwind/colors.js rename to tailwind/colors.cjs diff --git a/webpack/configuration.ts b/webpack/configuration.ts index 39b8bef8e5..deb4e50b47 100644 --- a/webpack/configuration.ts +++ b/webpack/configuration.ts @@ -12,7 +12,7 @@ const settings = { test_root_path: `${FE_BUILD_DIR}-test`, cache_path: 'tmp/cache', resolved_paths: [], - extensions: [ '.mjs', '.js', '.jsx', '.ts', '.tsx', '.sass', '.scss', '.css', '.module.sass', '.module.scss', '.module.css', '.png', '.svg', '.gif', '.jpeg', '.jpg' ], + extensions: [ '.js', '.jsx', '.cjs', '.mjs', '.ts', '.tsx', '.sass', '.scss', '.css', '.module.sass', '.module.scss', '.module.css', '.png', '.svg', '.gif', '.jpeg', '.jpg' ], }; const outputDir = env.NODE_ENV === 'test' ? settings.test_root_path : settings.public_root_path; diff --git a/webpack/rules/babel.ts b/webpack/rules/babel.ts index 21e9c72db9..9946bc87a6 100644 --- a/webpack/rules/babel.ts +++ b/webpack/rules/babel.ts @@ -7,7 +7,7 @@ import type { RuleSetRule } from 'webpack'; const isDevelopment = process.env.NODE_ENV === 'development'; const rule: RuleSetRule = { - test: /\.(js|jsx|mjs|ts|tsx)$/, + test: /\.(js|jsx|cjs|mjs|ts|tsx)$/, include: [ settings.source_path, ...settings.resolved_paths,