Merge branch 'cjs' into 'develop'
Rename some files to .cjs, make the codebase aware of .cjs and .mjs extensions See merge request soapbox-pub/soapbox!2190
This commit is contained in:
commit
f02e8cf282
14 changed files with 11 additions and 6 deletions
|
@ -5,4 +5,4 @@
|
||||||
/tmp/**
|
/tmp/**
|
||||||
/coverage/**
|
/coverage/**
|
||||||
/custom/**
|
/custom/**
|
||||||
!.eslintrc.js
|
!.eslintrc.cjs
|
||||||
|
|
Binary file not shown.
|
@ -48,10 +48,12 @@ lint-js:
|
||||||
changes:
|
changes:
|
||||||
- "**/*.js"
|
- "**/*.js"
|
||||||
- "**/*.jsx"
|
- "**/*.jsx"
|
||||||
|
- "**/*.cjs"
|
||||||
|
- "**/*.mjs"
|
||||||
- "**/*.ts"
|
- "**/*.ts"
|
||||||
- "**/*.tsx"
|
- "**/*.tsx"
|
||||||
- ".eslintignore"
|
- ".eslintignore"
|
||||||
- ".eslintrc.js"
|
- ".eslintrc.cjs"
|
||||||
|
|
||||||
lint-sass:
|
lint-sass:
|
||||||
stage: test
|
stage: test
|
||||||
|
@ -72,7 +74,7 @@ jest:
|
||||||
- "app/soapbox/**/*"
|
- "app/soapbox/**/*"
|
||||||
- "webpack/**/*"
|
- "webpack/**/*"
|
||||||
- "custom/**/*"
|
- "custom/**/*"
|
||||||
- "jest.config.js"
|
- "jest.config.cjs"
|
||||||
- "package.json"
|
- "package.json"
|
||||||
- "yarn.lock"
|
- "yarn.lock"
|
||||||
- ".gitlab-ci.yml"
|
- ".gitlab-ci.yml"
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
{
|
{
|
||||||
"*.js": "eslint --cache",
|
"*.js": "eslint --cache",
|
||||||
|
"*.cjs": "eslint --cache",
|
||||||
|
"*.mjs": "eslint --cache",
|
||||||
"*.ts": "eslint --cache",
|
"*.ts": "eslint --cache",
|
||||||
|
"*.tsx": "eslint --cache",
|
||||||
"app/styles/**/*.scss": "stylelint"
|
"app/styles/**/*.scss": "stylelint"
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -25,7 +25,7 @@
|
||||||
"test:coverage": "${npm_execpath} run test --coverage",
|
"test:coverage": "${npm_execpath} run test --coverage",
|
||||||
"test:all": "${npm_execpath} run test:coverage && ${npm_execpath} run lint",
|
"test:all": "${npm_execpath} run test:coverage && ${npm_execpath} run lint",
|
||||||
"lint": "${npm_execpath} run lint:js && ${npm_execpath} run lint:sass",
|
"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",
|
"lint:sass": "npx stylelint app/styles/**/*.scss",
|
||||||
"prepare": "husky install"
|
"prepare": "husky install"
|
||||||
},
|
},
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -12,7 +12,7 @@ const settings = {
|
||||||
test_root_path: `${FE_BUILD_DIR}-test`,
|
test_root_path: `${FE_BUILD_DIR}-test`,
|
||||||
cache_path: 'tmp/cache',
|
cache_path: 'tmp/cache',
|
||||||
resolved_paths: [],
|
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;
|
const outputDir = env.NODE_ENV === 'test' ? settings.test_root_path : settings.public_root_path;
|
||||||
|
|
|
@ -7,7 +7,7 @@ import type { RuleSetRule } from 'webpack';
|
||||||
const isDevelopment = process.env.NODE_ENV === 'development';
|
const isDevelopment = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
const rule: RuleSetRule = {
|
const rule: RuleSetRule = {
|
||||||
test: /\.(js|jsx|mjs|ts|tsx)$/,
|
test: /\.(js|jsx|cjs|mjs|ts|tsx)$/,
|
||||||
include: [
|
include: [
|
||||||
settings.source_path,
|
settings.source_path,
|
||||||
...settings.resolved_paths,
|
...settings.resolved_paths,
|
||||||
|
|
Loading…
Reference in a new issue