mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Add mjs support to eslint
GitOrigin-RevId: d2db7eb14e3d68a7dc95b24c98cee0d41ccd7e74
This commit is contained in:
parent
2117bfe29d
commit
05a7f1e632
1 changed files with 21 additions and 6 deletions
|
@ -45,10 +45,10 @@ module.exports = {
|
||||||
{
|
{
|
||||||
// Node
|
// Node
|
||||||
files: [
|
files: [
|
||||||
'**/app/src/**/*.js',
|
'**/app/src/**/*.{js,mjs}',
|
||||||
'app.js',
|
'app.{js,mjs}',
|
||||||
'i18next-scanner.config.js',
|
'i18next-scanner.config.js',
|
||||||
'scripts/**/*.js',
|
'scripts/**/*.{js,mjs}',
|
||||||
'webpack.config*.js',
|
'webpack.config*.js',
|
||||||
],
|
],
|
||||||
env: {
|
env: {
|
||||||
|
@ -89,9 +89,24 @@ module.exports = {
|
||||||
'@typescript-eslint/no-unused-expressions': 'off',
|
'@typescript-eslint/no-unused-expressions': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// ES specific rules
|
||||||
|
files: ['**/app/src/**/*.mjs'],
|
||||||
|
rules: {
|
||||||
|
'import/no-unresolved': 'error',
|
||||||
|
'import/extensions': [
|
||||||
|
'error',
|
||||||
|
'ignorePackages',
|
||||||
|
{
|
||||||
|
js: 'always',
|
||||||
|
mjs: 'always',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// Backend specific rules
|
// Backend specific rules
|
||||||
files: ['**/app/src/**/*.js', 'app.js'],
|
files: ['**/app/src/**/*.{js,mjs}', 'app.{js,mjs}'],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
tsconfigRootDir: __dirname,
|
tsconfigRootDir: __dirname,
|
||||||
project: './tsconfig.backend.json',
|
project: './tsconfig.backend.json',
|
||||||
|
@ -409,8 +424,8 @@ module.exports = {
|
||||||
// Backend: Use @overleaf/logger
|
// Backend: Use @overleaf/logger
|
||||||
// Docs: https://manual.dev-overleaf.com/development/code/logging/#structured-logging
|
// Docs: https://manual.dev-overleaf.com/development/code/logging/#structured-logging
|
||||||
'**/app/**/*.{js,cjs,mjs}',
|
'**/app/**/*.{js,cjs,mjs}',
|
||||||
'app.js',
|
'app.{js,mjs}',
|
||||||
'modules/*/*.js',
|
'modules/*/*.{js,mjs}',
|
||||||
// Frontend: Prefer debugConsole over bare console
|
// Frontend: Prefer debugConsole over bare console
|
||||||
// Docs: https://manual.dev-overleaf.com/development/code/logging/#frontend
|
// Docs: https://manual.dev-overleaf.com/development/code/logging/#frontend
|
||||||
'**/frontend/**/*.{js,jsx,ts,tsx}',
|
'**/frontend/**/*.{js,jsx,ts,tsx}',
|
||||||
|
|
Loading…
Reference in a new issue