Skip to content

Instantly share code, notes, and snippets.

@montasim
Created June 27, 2024 18:39
Show Gist options
  • Save montasim/abe993bc452986486319a3af8138e53c to your computer and use it in GitHub Desktop.
Save montasim/abe993bc452986486319a3af8138e53c to your computer and use it in GitHub Desktop.
This configuration file sets up linting rules and environments for a JavaScript project. It includes settings for ECMAScript 2020 features, enforces coding styles, and configures plugins for additional linting capabilities.
export default {
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
languageOptions: {
ecmaVersion: 2020, // Updated for more ES6+ features
sourceType: 'module',
globals: {
jest: 'readonly',
},
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
plugins: {
jest: {},
security: {},
prettier: {},
},
rules: {
'no-console': 'warn',
'func-names': 'off',
'no-underscore-dangle': 'off',
'consistent-return': 'off',
'jest/expect-expect': 'off',
'security/detect-object-injection': 'off',
quotes: [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: true },
],
semi: ['error', 'always'],
'prefer-arrow-callback': ['error', { allowNamedFunctions: false }],
'prefer-const': 'error',
'arrow-spacing': ['error', { before: true, after: true }],
'no-var': 'error',
'object-shorthand': ['error', 'always'],
'prefer-template': 'error',
},
ignores: [
'.idea/**',
'node_modules/**',
'build/**',
'logs/**',
'yarn.lock',
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment