Skip to content

Commit

Permalink
Use @jhwelch/mmm-eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
JHWelch committed Nov 18, 2024
1 parent 69d8a23 commit dab1352
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 50 deletions.
49 changes: 2 additions & 47 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,50 +1,5 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import stylisticJs from '@stylistic/eslint-plugin-js';
import mmm from '@jhwelch/mmm-eslint-config';

export default [
{files: ['**/*.js'], languageOptions: {sourceType: 'commonjs'}},
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
{
languageOptions: {
globals: {
...globals.jest,
Log: 'readonly',
nunjucks: 'writable',
translate: 'writable',
},
},
plugins: {
'@stylistic': stylisticJs,
},
rules: {
// Stylistic rules
'@stylistic/comma-dangle': ['error', 'always-multiline'],
'@stylistic/indent': ['error', 2],
'@stylistic/max-len': ['error', {
ignoreStrings: true,
ignoreTrailingComments: true,
ignoreUrls: true,
tabWidth: 2,
}],
'@stylistic/no-multi-spaces': 'error',
'@stylistic/no-multiple-empty-lines': ['error', { max: 1 }],
'@stylistic/quote-props': ['error', 'as-needed'],
'@stylistic/quotes': ['error', 'single', {
avoidEscape: true,
}],
'@stylistic/semi': ['error', 'always'],
'@stylistic/space-before-function-paren': ['error', 'always'],

// ESLint rules
'no-console': ['error', {
allow: ['warn', 'error'],
}],
'no-unused-vars': ['error', {
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
}],
},
},
...mmm,
];
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@eslint/js": "^9.15.0",
"@fetch-mock/jest": "^0.2.6",
"@stylistic/eslint-plugin-js": "^2.10.1",
"eslint": "^9.15.0",
"@jhwelch/mmm-eslint-config": "^1.0.0",
"eslint": "^9.14.0",
"jest": "^29.7.0",
"nunjucks": "^3.2.4"
},
Expand Down

0 comments on commit dab1352

Please sign in to comment.