Skip to content

Commit

Permalink
chore: transform config files from json to js
Browse files Browse the repository at this point in the history
thus, we are allowed to add comments to the rules

Issues: MOL-29362
  • Loading branch information
Txabox committed Apr 23, 2024
1 parent a02b477 commit 281a803
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint && npm run test && npm run format
npm run lint && npm run test
4 changes: 2 additions & 2 deletions configurations/base.json → configurations/base.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"env": {
"browser": true,
"es6": true,
Expand Down Expand Up @@ -658,4 +658,4 @@
".js"
]
}
}
};
4 changes: 2 additions & 2 deletions configurations/jest.json → configurations/jest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"env": {
"jest": true
},
Expand All @@ -11,4 +11,4 @@
"jest/no-identical-title": "error",
"jest/valid-expect": "error"
}
}
};
4 changes: 2 additions & 2 deletions configurations/lodash.json → configurations/lodash.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"plugins": [
"lodash"
],
Expand Down Expand Up @@ -65,4 +65,4 @@
"lodash/prop-shorthand": 1,
"lodash/unwrap": 1
}
}
};
4 changes: 2 additions & 2 deletions configurations/mocha.json → configurations/mocha.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"env": {
"mocha": true
},
Expand All @@ -19,4 +19,4 @@
"mocha/no-return-and-callback": 2,
"mocha/no-top-level-hooks": 2
}
}
};
4 changes: 2 additions & 2 deletions configurations/react.json → configurations/react.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"plugins": [
"react"
],
Expand Down Expand Up @@ -104,4 +104,4 @@
"react/style-prop-object": 2,
"react/void-dom-elements-no-children": 2
}
}
};
4 changes: 2 additions & 2 deletions configurations/webpack.json → configurations/webpack.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
module.exports = {
"settings": {
"import/resolver": "webpack"
}
}
};
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./configurations/base.json');
module.exports = require('./configurations/base');
2 changes: 1 addition & 1 deletion jest.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./configurations/jest.json');
module.exports = require('./configurations/jest');
2 changes: 1 addition & 1 deletion lodash.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./configurations/lodash.json');
module.exports = require('./configurations/lodash');
2 changes: 1 addition & 1 deletion mocha.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./configurations/mocha.json');
module.exports = require('./configurations/mocha');
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"devDependencies": {
"eslint": "^9.0.0",
"husky": "^7.0.2",
"jsonlint": "^1.6.3",
"semantic-release": "^22.0.12"
},
"engines": {
Expand All @@ -46,7 +45,6 @@
"url": "https://github.com/mailonline/eslint-config-mailonline"
},
"scripts": {
"format": "jsonlint --sort-keys --in-place --indent ' ' ./configurations/*.json",
"lint": "echo 'This project has no linting' && exit 0",
"prepare": "husky install",
"semantic-release": "semantic-release",
Expand Down
2 changes: 1 addition & 1 deletion react.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./configurations/react.json');
module.exports = require('./configurations/react');
2 changes: 1 addition & 1 deletion webpack.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./configurations/webpack.json');
module.exports = require('./configurations/webpack');
63 changes: 0 additions & 63 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -794,11 +794,6 @@ JSONStream@^1.3.5:
jsonparse "^1.2.0"
through ">=2.2.7 <3"

JSV@^4.0.x:
version "4.0.2"
resolved "https://registry.yarnpkg.com/JSV/-/JSV-4.0.2.tgz#d077f6825571f82132f9dffaed587b4029feff57"
integrity sha512-ZJ6wx9xaKJ3yFUhq5/sk82PJMuUyLk277I8mQeyDgCTjGdjWJIvPfaU5LIXaMuaN2UO1X3kZH4+lgphublZUHw==

abbrev@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-2.0.0.tgz#cf59829b8b4f03f89dda2771cb7f3653828c89bf"
Expand Down Expand Up @@ -881,11 +876,6 @@ ansi-styles@^6.1.0:
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5"
integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==

ansi-styles@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178"
integrity sha512-3iF4FIKdxaVYT3JqQuY3Wat/T2t7TRbbQ94Fu50ZUCbLy4TFbTzr90NOHQodQkNqmeEGCw8WbeP78WNi6SKYUA==

any-promise@^1.0.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
Expand Down Expand Up @@ -1195,15 +1185,6 @@ chalk@^5.3.0:
resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385"
integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==

chalk@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f"
integrity sha512-sQfYDlfv2DGVtjdoQqxS0cEZDroyG8h6TamA6rvxwlrU5BaSLDx9xhatBYl2pxZ7gmpNaPFVwBtdGdu5rQ+tYQ==
dependencies:
ansi-styles "~1.0.0"
has-color "~0.1.0"
strip-ansi "~0.1.0"

char-regex@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf"
Expand Down Expand Up @@ -1818,14 +1799,6 @@ eslint-plugin-filenames@^1.3.2:
lodash.snakecase "4.1.1"
lodash.upperfirst "4.3.1"

eslint-plugin-flowtype@^8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-8.0.3.tgz#e1557e37118f24734aa3122e7536a038d34a4912"
integrity sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ==
dependencies:
lodash "^4.17.21"
string-natural-compare "^3.0.1"

eslint-plugin-import@^2.29.1:
version "2.29.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz#d45b37b5ef5901d639c15270d74d46d161150643"
Expand Down Expand Up @@ -2458,11 +2431,6 @@ has-bigints@^1.0.1, has-bigints@^1.0.2:
resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa"
integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==

has-color@~0.1.0:
version "0.1.7"
resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f"
integrity sha512-kaNz5OTAYYmt646Hkqw50/qyxP2vFnTVu5AQ1Zmk22Kk5+4Qx6BpO8+u7IKsML5fOsFk0ZT0AcCJNYwcvaLBvw==

has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
Expand Down Expand Up @@ -3091,14 +3059,6 @@ jsonfile@^6.0.1:
optionalDependencies:
graceful-fs "^4.1.6"

jsonlint@^1.6.3:
version "1.6.3"
resolved "https://registry.yarnpkg.com/jsonlint/-/jsonlint-1.6.3.tgz#cb5e31efc0b78291d0d862fbef05900adf212988"
integrity sha512-jMVTMzP+7gU/IyC6hvKyWpUU8tmTkK5b3BPNuMI9U8Sit+YAWLlZwB6Y6YrdCxfg2kNz05p3XY3Bmm4m26Nv3A==
dependencies:
JSV "^4.0.x"
nomnom "^1.5.x"

jsonparse@^1.2.0, jsonparse@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280"
Expand Down Expand Up @@ -3628,14 +3588,6 @@ node-releases@^2.0.14:
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b"
integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==

nomnom@^1.5.x:
version "1.8.1"
resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.8.1.tgz#2151f722472ba79e50a76fc125bb8c8f2e4dc2a7"
integrity sha512-5s0JxqhDx9/rksG2BTMVN1enjWSvPidpoSgViZU4ZXULyTe+7jxcCRLB6f42Z0l1xYJpleCBtSyY6Lwg3uu5CQ==
dependencies:
chalk "~0.4.0"
underscore "~1.6.0"

nopt@^7.0.0, nopt@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-7.2.0.tgz#067378c68116f602f552876194fd11f1292503d7"
Expand Down Expand Up @@ -4781,11 +4733,6 @@ stream-combiner2@~1.1.1:
duplexer2 "~0.1.0"
readable-stream "^2.0.2"

string-natural-compare@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==

"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
Expand Down Expand Up @@ -4887,11 +4834,6 @@ strip-ansi@^7.0.1:
dependencies:
ansi-regex "^6.0.1"

strip-ansi@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991"
integrity sha512-behete+3uqxecWlDAm5lmskaSaISA+ThQ4oNNBDTBJt0x2ppR6IPqfZNuj6BLaLJ/Sji4TPZlcRyOis8wXQTLg==

strip-bom@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
Expand Down Expand Up @@ -5183,11 +5125,6 @@ unbox-primitive@^1.0.2:
has-symbols "^1.0.3"
which-boxed-primitive "^1.0.2"

underscore@~1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8"
integrity sha512-z4o1fvKUojIWh9XuaVLUDdf86RQiq13AC1dmHbTpoyuu+bquHms76v16CjycCbec87J7z0k//SiQVk0sMdFmpQ==

unicode-emoji-modifier-base@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz#dbbd5b54ba30f287e2a8d5a249da6c0cef369459"
Expand Down

0 comments on commit 281a803

Please sign in to comment.