@perfective/eslint-config
Version:
ESLint shareable rules configuration
45 lines • 1.03 kB
JavaScript
import { parser as typescriptEslintParser } from 'typescript-eslint';
export function languageOptions() {
return {
sourceType: 'module',
ecmaVersion: 'latest',
parser: typescriptEslintParser,
parserOptions: {
ecmaFeatures: {
globalReturn: false,
impliedStrict: true
},
projectService: {
allowDefaultProject: ['?(.)*.?(m|c)js']
},
warnOnUnsupportedTypeScriptVersion: true
}
};
}
export function javascriptLanguageOptions() {
return {
sourceType: 'module',
ecmaVersion: 'latest',
parserOptions: {
ecmaFeatures: {
globalReturn: false,
impliedStrict: true
}
}
};
}
export function typescriptLanguageOptions() {
return {
sourceType: 'module',
ecmaVersion: 'latest',
parser: typescriptEslintParser,
parserOptions: {
ecmaFeatures: {
globalReturn: false,
impliedStrict: true
},
projectService: true,
warnOnUnsupportedTypeScriptVersion: true
}
};
}