Skip to content

Commit

Permalink
FIX deprecated rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Moreno committed Oct 17, 2024
1 parent dbc5eb4 commit becff07
Show file tree
Hide file tree
Showing 12 changed files with 191 additions and 36 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

12 changes: 0 additions & 12 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18
node-version: 20
- run: |
npm install
npm run lint
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18
node-version: 20
- env:
TAG: ${{ github.event.release.tag_name }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
28 changes: 28 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/node_modules"],
}, ...compat.extends(
"./packages/eslint-config-adidas-es5/index.js",
"./packages/eslint-config-adidas-env/node.js",
), {
languageOptions: {
ecmaVersion: 2024,
sourceType: "script",
},

rules: {
"no-magic-numbers": "off",
},
}];
152 changes: 151 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"lint": "eslint packages"
},
"devDependencies": {
"@eslint/eslintrc": "3.1.0",
"@eslint/js": "9.12.0",
"chalk": "5.3.0",
"eslint": "9.12.0",
"eslint-plugin-n": "17.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-adidas-es15/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: ['eslint-config-adidas-es13'].map(require.resolve),
extends: [ 'eslint-config-adidas-es13' ].map(require.resolve),
parserOptions: {
ecmaVersion: 15
}
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-adidas-es5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This should be the base for every JavaScript project, regardless of the ECMAScri
## Install

```
npm i --save-dev eslint@9 eslint-config-adidas-es5
npm i --save-dev eslint@9 eslint-plugin-jsdoc@50 eslint-config-adidas-es5
```

## Usage
Expand Down
18 changes: 2 additions & 16 deletions packages/eslint-config-adidas-es5/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
plugins: [ 'jsdoc' ],
extends: [ 'plugin:jsdoc/recommended' ],
parserOptions: {
ecmaVersion: 5
},
Expand Down Expand Up @@ -338,22 +340,6 @@ module.exports = {
'template-tag-spacing': 'off',
'unicode-bom': [ 'error', 'never' ],
'use-isnan': 'error',
'valid-jsdoc': [
'error', {
prefer: {
return: 'returns'
},
preferType: {
array: 'Array',
Boolean: 'boolean',
Number: 'number',
String: 'string'
},
requireParamDescription: true,
requireReturn: false,
requireReturnDescription: true
}
],
'valid-typeof': [ 'error', { requireStringLiterals: true }],
'vars-on-top': 'error',
'wrap-iife': [ 'error', 'outside' ],
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config-adidas-es5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
},
"main": "./index.js",
"peerDependencies": {
"eslint": "^9"
"eslint": "^9",
"eslint-plugin-jsdoc": "^50"
},
"files": [
"index.js",
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config-adidas-typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module.exports = {
extends: [
'adidas-es15',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended'
'plugin:@typescript-eslint/recommended',
'plugin:jsdoc/recommended-typescript'
],
rules: {
'@typescript-eslint/adjacent-overload-signatures': 'error',
Expand Down

0 comments on commit becff07

Please sign in to comment.