mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-30 06:59:41 -08:00
6a35812f92
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Waiting to run
Co-authored-by: Tomi Turtiainen <[email protected]>
42 lines
873 B
JavaScript
42 lines
873 B
JavaScript
/**
|
|
* @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,
|
|
};
|
|
};
|