Skip to content

Commit f586b34

Browse files
committed
use single package.json
Closes #6001.
1 parent 353e7c9 commit f586b34

File tree

9 files changed

+2405
-3253
lines changed

9 files changed

+2405
-3253
lines changed

assets/.eslintrc.js

Lines changed: 0 additions & 81 deletions
This file was deleted.

assets/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/js/phoenix/ajax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default class Ajax {
5353

5454
try {
5555
return JSON.parse(resp)
56-
} catch (e){
56+
} catch {
5757
console && console.log("failed to parse JSON response", resp)
5858
return null
5959
}

assets/package.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import jest from "eslint-plugin-jest"
2+
import js from "@eslint/js"
3+
import stylisticJs from "@stylistic/eslint-plugin-js"
4+
5+
export default [
6+
{
7+
// eslint config is very unintuitive; they will match an js file in any
8+
// directory by default and you can only expand this;
9+
// moreover, to have a global ignore, it must be specified without
10+
// any other key as a separate object...
11+
ignores: [
12+
"integration_test/",
13+
"installer/",
14+
"doc/",
15+
"deps/",
16+
"coverage/",
17+
"priv/",
18+
"tmp/",
19+
"test/"
20+
],
21+
},
22+
{
23+
...js.configs.recommended,
24+
25+
plugins: {
26+
jest,
27+
"@stylistic/js": stylisticJs
28+
},
29+
30+
languageOptions: {
31+
globals: {
32+
...jest.environments.globals.globals,
33+
global: "writable",
34+
},
35+
36+
ecmaVersion: 12,
37+
sourceType: "module",
38+
},
39+
40+
rules: {
41+
"@stylistic/js/indent": ["error", 2, {
42+
SwitchCase: 1,
43+
}],
44+
45+
"@stylistic/js/linebreak-style": ["error", "unix"],
46+
"@stylistic/js/quotes": ["error", "double"],
47+
"@stylistic/js/semi": ["error", "never"],
48+
49+
"@stylistic/js/object-curly-spacing": ["error", "never", {
50+
objectsInObjects: false,
51+
arraysInObjects: false,
52+
}],
53+
54+
"@stylistic/js/array-bracket-spacing": ["error", "never"],
55+
56+
"@stylistic/js/comma-spacing": ["error", {
57+
before: false,
58+
after: true,
59+
}],
60+
61+
"@stylistic/js/computed-property-spacing": ["error", "never"],
62+
63+
"@stylistic/js/space-before-blocks": ["error", {
64+
functions: "never",
65+
keywords: "never",
66+
classes: "always",
67+
}],
68+
69+
"@stylistic/js/keyword-spacing": ["error", {
70+
overrides: {
71+
if: {
72+
after: false,
73+
},
74+
75+
for: {
76+
after: false,
77+
},
78+
79+
while: {
80+
after: false,
81+
},
82+
83+
switch: {
84+
after: false,
85+
},
86+
},
87+
}],
88+
89+
"@stylistic/js/eol-last": ["error", "always"],
90+
91+
"no-unused-vars": ["error", {
92+
argsIgnorePattern: "^_",
93+
varsIgnorePattern: "^_",
94+
}],
95+
96+
"no-useless-escape": "off",
97+
"no-cond-assign": "off",
98+
"no-case-declarations": "off",
99+
},
100+
}]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ module.exports = {
2323
},
2424

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

0 commit comments

Comments
 (0)