mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
refactor: Move vitest-config and eslint-config packages to @n8n (#13530)
This commit is contained in:
41
packages/@n8n/eslint-config/shared.js
Normal file
41
packages/@n8n/eslint-config/shared.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @type {(dir: string, mode: 'frontend' | undefined) => import('@types/eslint').ESLint.ConfigData}
|
||||
*/
|
||||
module.exports = (tsconfigRootDir, mode) => {
|
||||
const isFrontend = mode === 'frontend';
|
||||
const parser = isFrontend ? 'vue-eslint-parser' : '@typescript-eslint/parser';
|
||||
const extraParserOptions = isFrontend
|
||||
? {
|
||||
extraFileExtensions: ['.vue'],
|
||||
parser: {
|
||||
ts: '@typescript-eslint/parser',
|
||||
js: '@typescript-eslint/parser',
|
||||
vue: 'vue-eslint-parser',
|
||||
template: 'vue-eslint-parser',
|
||||
},
|
||||
}
|
||||
: {};
|
||||
|
||||
const settings = {
|
||||
'import/parsers': {
|
||||
'@typescript-eslint/parser': ['.ts'],
|
||||
},
|
||||
|
||||
'import/resolver': {
|
||||
typescript: {
|
||||
tsconfigRootDir,
|
||||
project: './tsconfig.json',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
parser,
|
||||
parserOptions: {
|
||||
tsconfigRootDir,
|
||||
project: ['./tsconfig.json'],
|
||||
...extraParserOptions,
|
||||
},
|
||||
settings,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user