Skip to content

Commit

Permalink
use single package.json (#6044)
Browse files Browse the repository at this point in the history
Closes #6001.
  • Loading branch information
SteffenDE authored Jan 11, 2025
1 parent bcc7082 commit 484245c
Show file tree
Hide file tree
Showing 9 changed files with 2,405 additions and 3,253 deletions.
81 changes: 0 additions & 81 deletions assets/.eslintrc.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion assets/js/phoenix/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class Ajax {

try {
return JSON.parse(resp)
} catch (e){
} catch {
console && console.log("failed to parse JSON response", resp)
return null
}
Expand Down
37 changes: 0 additions & 37 deletions assets/package.json

This file was deleted.

File renamed without changes.
100 changes: 100 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import jest from "eslint-plugin-jest"
import js from "@eslint/js"
import stylisticJs from "@stylistic/eslint-plugin-js"

export default [
{
// eslint config is very unintuitive; they will match an js file in any
// directory by default and you can only expand this;
// moreover, to have a global ignore, it must be specified without
// any other key as a separate object...
ignores: [
"integration_test/",
"installer/",
"doc/",
"deps/",
"coverage/",
"priv/",
"tmp/",
"test/"
],
},
{
...js.configs.recommended,

plugins: {
jest,
"@stylistic/js": stylisticJs
},

languageOptions: {
globals: {
...jest.environments.globals.globals,
global: "writable",
},

ecmaVersion: 12,
sourceType: "module",
},

rules: {
"@stylistic/js/indent": ["error", 2, {
SwitchCase: 1,
}],

"@stylistic/js/linebreak-style": ["error", "unix"],
"@stylistic/js/quotes": ["error", "double"],
"@stylistic/js/semi": ["error", "never"],

"@stylistic/js/object-curly-spacing": ["error", "never", {
objectsInObjects: false,
arraysInObjects: false,
}],

"@stylistic/js/array-bracket-spacing": ["error", "never"],

"@stylistic/js/comma-spacing": ["error", {
before: false,
after: true,
}],

"@stylistic/js/computed-property-spacing": ["error", "never"],

"@stylistic/js/space-before-blocks": ["error", {
functions: "never",
keywords: "never",
classes: "always",
}],

"@stylistic/js/keyword-spacing": ["error", {
overrides: {
if: {
after: false,
},

for: {
after: false,
},

while: {
after: false,
},

switch: {
after: false,
},
},
}],

"@stylistic/js/eol-last": ["error", "always"],

"no-unused-vars": ["error", {
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
}],

"no-useless-escape": "off",
"no-cond-assign": "off",
"no-case-declarations": "off",
},
}]
4 changes: 2 additions & 2 deletions assets/jest.config.js → jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ module.exports = {
},

// The regexp pattern or array of patterns that Jest uses to detect test files
testRegex: "/test/.*_test\\.js$",
};
testRegex: "/assets/test/.*_test\\.js$",
}
Loading

0 comments on commit 484245c

Please sign in to comment.