You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** NOTE: ONLY a single nested override level is supported.
Eslint overrides will be used to apply multiple eslint configs in the project https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns
ESlint also supports nested overrides, in which will be applied when both the child and parent patterns are matched.
https://github.com/eslint/eslint/pull/11554
// important - the fix that allows multiple nested extensions and overrides, removing the error throw, is not yet merged, not even in the `next` version published.
*/
module.exports.templateConfig={
root: true,// prevent lookup for eslint config file.
'eslint-plugin-babel',// eslint-plugin-babel re-implements (from the base eslint rules) problematic rules so they do not give false positives or negatives
'prettier',
],
rules: {
// add prettier integration
'prettier/prettier': [
'warn',
prettierConfig,
{
usePrettierrc: true,
},
],
},
env: {
node: true,
},
}
lettypescriptFile={
files: ['**.ts'],
// correctly parse typescript with babel parser - https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/typescript-estree/tests/ast-alignment/parse.ts#L16
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
project: typescriptConfigPath,// Follows the path should be consumed by a function and replaced.
prettierTypescriptEslint.rules,// Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
// prettier Eslint Recommended are `prettier` plugin and `error` rule // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
{
'prettier/prettier': 'warn',
},
),
env: {
node: true,
},
}
letoverrides=[
// specific different parser according to file extension.
// Allow imports in test/demos from devDependencies
// Allow underscore dangle
// Do not prefer default exports
// Do not prefer no file extension
// USAGE:
// • require directly and make sure internal plugin names are resolved correctly (./@open-wc/eslint-config/node_modules/<plugins...>), as it will be referenced by the location of the target project's esling config file (<target project>/configuration/eslint.config.js)
// OR
// • use eslint config: (make sure to add node_modules to require path to resolve plugins correctly) https://github.com/open-wc/open-wc/blob/master/packages/eslint-config/package.json
// "@open-wc/eslint-config",
// "eslint-config-prettier"
// */
// let openWebcomponentEslintConfig = require('@open-wc/eslint-config') // https://github.com/open-wc/open-wc/ > eslint-config