scaffold-davaverse-client-ui
Version:
A scaffolding tool for creating Dataverse client-side web resource projects with TypeScript, ESLint, Prettier, and Rollup
119 lines (115 loc) • 3.93 kB
JavaScript
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import prettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import prettierPlugin from 'eslint-plugin-prettier';
export default [
js.configs.recommended,
{
ignores: ['dist/**', 'node_modules/**']
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json'
},
globals: {
// Node.js globals
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
// Browser globals
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
localStorage: 'readonly',
sessionStorage: 'readonly',
// Dynamics 365 / XRM globals
Xrm: 'readonly'
}
},
plugins: {
'@typescript-eslint': tseslint,
import: importPlugin,
prettier: prettierPlugin
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
}
}
},
rules: {
...tseslint.configs.recommended.rules,
'prettier/prettier': 'error',
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off',
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
'no-underscore-dangle': 'off',
'no-console': ['error', { allow: ['info', 'error', 'warn', 'debug'] }],
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index'
],
'newlines-between': 'always'
}
]
}
},
{
files: ['**/*.js', '**/*.mjs'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
// Node.js globals
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
// Browser globals
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
localStorage: 'readonly',
sessionStorage: 'readonly'
}
},
plugins: {
import: importPlugin,
prettier: prettierPlugin
},
rules: {
'prettier/prettier': 'error',
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off',
'no-underscore-dangle': 'off',
'no-console': ['error', { allow: ['info', 'error', 'warn', 'debug'] }],
'import/prefer-default-export': 'off',
'import/extensions': 'off'
}
},
prettier
];