Skip to content

Commit

Permalink
Merge pull request #36 from MailOnline/MOL-28513/add-js-no-undef-rule
Browse files Browse the repository at this point in the history
MOL-28513: Add `no-undef` rule for `.js*` files
  • Loading branch information
jasonrowsell authored Jan 24, 2024
2 parents b9188a2 + 1242d74 commit 6d44169
Show file tree
Hide file tree
Showing 3 changed files with 599 additions and 871 deletions.
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const rules = {
'no-sparse-arrays': 'error',
'no-template-curly-in-string': 'error',
'no-throw-literal': 'error',
'no-undef': 'error',
'no-undef-init': 'error',
'no-unneeded-ternary': 'error',
'no-unsafe-finally': 'error',
Expand Down Expand Up @@ -158,14 +159,25 @@ const rules = {
'use-isnan': 'error'
};

const overrides = [
{
files: ['*.ts', '*.mts', '*.cts', '*.tsx'],
rules: {
'no-undef': 'off'
}
}
];

module.exports = {
env: {
browser: true,
es2021: true,
jest: true,
node: true
},
extends: ['eslint-config-prettier'],
ignorePatterns: ['**/*.config.js', '**/coverage/*', '**/dist/*'],
overrides,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test": "echo 'This project has no tests' && exit 0"
},
"devDependencies": {
"eslint": "^8.54.0",
"eslint": "^8.56.0",
"husky": "^8.0.3",
"mol-conventional-changelog": "^1.4.3",
"prettier": "^2.4.1",
Expand All @@ -39,19 +39,22 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"eslint-config-prettier": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-unicorn": "^49.0.0"
"eslint-plugin-unicorn": "^50.0.1"
},
"config": {
"commitizen": {
"path": "./node_modules/mol-conventional-changelog"
}
},
"engines": {
"node": "20.x"
}
}
Loading

0 comments on commit 6d44169

Please sign in to comment.