Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 2c07920

Browse files
committed
style(cms): run eslint
1 parent 15c1aad commit 2c07920

File tree

15 files changed

+206
-226
lines changed

15 files changed

+206
-226
lines changed

cms/config/admin.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
export default ({ env }) => ({
2-
auth: {
3-
secret: env('ADMIN_JWT_SECRET'),
4-
},
5-
apiToken: {
6-
salt: env('API_TOKEN_SALT'),
7-
},
8-
transfer: {
9-
token: {
10-
salt: env('TRANSFER_TOKEN_SALT'),
11-
},
12-
},
13-
flags: {
14-
nps: env.bool('FLAG_NPS', true),
15-
},
16-
watchIgnoreFiles: [
17-
'**/config/sync/**',
18-
],
2+
auth: {
3+
secret: env("ADMIN_JWT_SECRET"),
4+
},
5+
apiToken: {
6+
salt: env("API_TOKEN_SALT"),
7+
},
8+
transfer: {
9+
token: {
10+
salt: env("TRANSFER_TOKEN_SALT"),
11+
},
12+
},
13+
flags: {
14+
nps: env.bool("FLAG_NPS", true),
15+
},
16+
watchIgnoreFiles: [
17+
"**/config/sync/**",
18+
],
1919
});

cms/config/api.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
2-
rest: {
3-
defaultLimit: 25,
4-
maxLimit: 100,
5-
withCount: true,
6-
},
2+
rest: {
3+
defaultLimit: 25,
4+
maxLimit: 100,
5+
withCount: true,
6+
},
77
};

cms/config/database.ts

Lines changed: 74 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,79 @@
1-
import path from 'path';
1+
import path from "path";
22

33
export default ({ env }) => {
4-
const client = env('DATABASE_CLIENT', 'sqlite');
4+
const client = env("DATABASE_CLIENT", "sqlite");
55

6-
const connections = {
7-
mysql: {
8-
connection: {
9-
connectionString: env('DATABASE_URL'),
10-
host: env('DATABASE_HOST', 'localhost'),
11-
port: env.int('DATABASE_PORT', 3306),
12-
database: env('DATABASE_NAME', 'strapi'),
13-
user: env('DATABASE_USERNAME', 'strapi'),
14-
password: env('DATABASE_PASSWORD', 'strapi'),
15-
ssl: env.bool('DATABASE_SSL', false) && {
16-
key: env('DATABASE_SSL_KEY', undefined),
17-
cert: env('DATABASE_SSL_CERT', undefined),
18-
ca: env('DATABASE_SSL_CA', undefined),
19-
capath: env('DATABASE_SSL_CAPATH', undefined),
20-
cipher: env('DATABASE_SSL_CIPHER', undefined),
21-
rejectUnauthorized: env.bool(
22-
'DATABASE_SSL_REJECT_UNAUTHORIZED',
23-
true
24-
),
25-
},
26-
},
27-
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
28-
},
29-
mysql2: {
30-
connection: {
31-
host: env('DATABASE_HOST', 'localhost'),
32-
port: env.int('DATABASE_PORT', 3306),
33-
database: env('DATABASE_NAME', 'strapi'),
34-
user: env('DATABASE_USERNAME', 'strapi'),
35-
password: env('DATABASE_PASSWORD', 'strapi'),
36-
ssl: env.bool('DATABASE_SSL', false) && {
37-
key: env('DATABASE_SSL_KEY', undefined),
38-
cert: env('DATABASE_SSL_CERT', undefined),
39-
ca: env('DATABASE_SSL_CA', undefined),
40-
capath: env('DATABASE_SSL_CAPATH', undefined),
41-
cipher: env('DATABASE_SSL_CIPHER', undefined),
42-
rejectUnauthorized: env.bool(
43-
'DATABASE_SSL_REJECT_UNAUTHORIZED',
44-
true
45-
),
46-
},
47-
},
48-
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
49-
},
50-
postgres: {
51-
connection: {
52-
connectionString: env('DATABASE_URL'),
53-
host: env('DATABASE_HOST', 'localhost'),
54-
port: env.int('DATABASE_PORT', 5432),
55-
database: env('DATABASE_NAME', 'strapi'),
56-
user: env('DATABASE_USERNAME', 'strapi'),
57-
password: env('DATABASE_PASSWORD', 'strapi'),
58-
ssl: env.bool('DATABASE_SSL', false) && {
59-
key: env('DATABASE_SSL_KEY', undefined),
60-
cert: env('DATABASE_SSL_CERT', undefined),
61-
ca: env('DATABASE_SSL_CA', undefined),
62-
capath: env('DATABASE_SSL_CAPATH', undefined),
63-
cipher: env('DATABASE_SSL_CIPHER', undefined),
64-
rejectUnauthorized: env.bool(
65-
'DATABASE_SSL_REJECT_UNAUTHORIZED',
66-
true
67-
),
68-
},
69-
schema: env('DATABASE_SCHEMA', 'public'),
70-
},
71-
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
72-
},
73-
sqlite: {
74-
connection: {
75-
filename: path.join(
76-
__dirname,
77-
'..',
78-
'..',
79-
env('DATABASE_FILENAME', '.tmp/data.db')
80-
),
81-
},
82-
useNullAsDefault: true,
83-
},
84-
};
6+
const connections = {
7+
mysql: {
8+
connection: {
9+
connectionString: env("DATABASE_URL"),
10+
host: env("DATABASE_HOST", "localhost"),
11+
port: env.int("DATABASE_PORT", 3306),
12+
database: env("DATABASE_NAME", "strapi"),
13+
user: env("DATABASE_USERNAME", "strapi"),
14+
password: env("DATABASE_PASSWORD", "strapi"),
15+
ssl: env.bool("DATABASE_SSL", false) && {
16+
key: env("DATABASE_SSL_KEY", undefined),
17+
cert: env("DATABASE_SSL_CERT", undefined),
18+
ca: env("DATABASE_SSL_CA", undefined),
19+
capath: env("DATABASE_SSL_CAPATH", undefined),
20+
cipher: env("DATABASE_SSL_CIPHER", undefined),
21+
rejectUnauthorized: env.bool("DATABASE_SSL_REJECT_UNAUTHORIZED", true),
22+
},
23+
},
24+
pool: { min: env.int("DATABASE_POOL_MIN", 2), max: env.int("DATABASE_POOL_MAX", 10) },
25+
},
26+
mysql2: {
27+
connection: {
28+
host: env("DATABASE_HOST", "localhost"),
29+
port: env.int("DATABASE_PORT", 3306),
30+
database: env("DATABASE_NAME", "strapi"),
31+
user: env("DATABASE_USERNAME", "strapi"),
32+
password: env("DATABASE_PASSWORD", "strapi"),
33+
ssl: env.bool("DATABASE_SSL", false) && {
34+
key: env("DATABASE_SSL_KEY", undefined),
35+
cert: env("DATABASE_SSL_CERT", undefined),
36+
ca: env("DATABASE_SSL_CA", undefined),
37+
capath: env("DATABASE_SSL_CAPATH", undefined),
38+
cipher: env("DATABASE_SSL_CIPHER", undefined),
39+
rejectUnauthorized: env.bool("DATABASE_SSL_REJECT_UNAUTHORIZED", true),
40+
},
41+
},
42+
pool: { min: env.int("DATABASE_POOL_MIN", 2), max: env.int("DATABASE_POOL_MAX", 10) },
43+
},
44+
postgres: {
45+
connection: {
46+
connectionString: env("DATABASE_URL"),
47+
host: env("DATABASE_HOST", "localhost"),
48+
port: env.int("DATABASE_PORT", 5432),
49+
database: env("DATABASE_NAME", "strapi"),
50+
user: env("DATABASE_USERNAME", "strapi"),
51+
password: env("DATABASE_PASSWORD", "strapi"),
52+
ssl: env.bool("DATABASE_SSL", false) && {
53+
key: env("DATABASE_SSL_KEY", undefined),
54+
cert: env("DATABASE_SSL_CERT", undefined),
55+
ca: env("DATABASE_SSL_CA", undefined),
56+
capath: env("DATABASE_SSL_CAPATH", undefined),
57+
cipher: env("DATABASE_SSL_CIPHER", undefined),
58+
rejectUnauthorized: env.bool("DATABASE_SSL_REJECT_UNAUTHORIZED", true),
59+
},
60+
schema: env("DATABASE_SCHEMA", "public"),
61+
},
62+
pool: { min: env.int("DATABASE_POOL_MIN", 2), max: env.int("DATABASE_POOL_MAX", 10) },
63+
},
64+
sqlite: {
65+
connection: {
66+
filename: path.join(__dirname, "..", "..", env("DATABASE_FILENAME", ".tmp/data.db")),
67+
},
68+
useNullAsDefault: true,
69+
},
70+
};
8571

86-
return {
87-
connection: {
88-
client,
89-
...connections[client],
90-
acquireConnectionTimeout: env.int('DATABASE_CONNECTION_TIMEOUT', 60000),
91-
},
92-
};
72+
return {
73+
connection: {
74+
client,
75+
...connections[client],
76+
acquireConnectionTimeout: env.int("DATABASE_CONNECTION_TIMEOUT", 60000),
77+
},
78+
};
9379
};

cms/config/middlewares.ts

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
1-
21
module.exports = [
3-
'strapi::errors',
4-
'strapi::security',
5-
{
6-
name: 'strapi::cors',
7-
config: {
8-
origin: ['http://localhost:3000', 'http://web:3000', 'http://localhost:1337', 'http://cms:1337'],
9-
methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'],
10-
headers: ['Content-Type', 'Authorization', 'Origin', 'Accept'],
11-
keepHeaderOnError: true,
12-
},
13-
},
14-
'strapi::poweredBy',
15-
'strapi::logger',
16-
'strapi::query',
17-
'strapi::body',
18-
'strapi::session',
19-
'strapi::favicon',
20-
'strapi::public',
21-
]
22-
23-
24-
25-
26-
2+
"strapi::errors",
3+
"strapi::security",
4+
{
5+
name: "strapi::cors",
6+
config: {
7+
origin: ["http://localhost:3000", "http://web:3000", "http://localhost:1337", "http://cms:1337"],
8+
methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"],
9+
headers: ["Content-Type", "Authorization", "Origin", "Accept"],
10+
keepHeaderOnError: true,
11+
},
12+
},
13+
"strapi::poweredBy",
14+
"strapi::logger",
15+
"strapi::query",
16+
"strapi::body",
17+
"strapi::session",
18+
"strapi::favicon",
19+
"strapi::public",
20+
];

cms/config/plugins.ts

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@
22
"use strict";
33

44
module.exports = ({ env }) => ({
5-
menus: {
6-
config: {
7-
layouts: {
8-
menuItem: {
9-
link: [
10-
{
11-
input: {
12-
label: "Page Relation",
13-
name: "page_relation",
14-
type: "relation",
15-
},
16-
grid: {
17-
col: 6,
18-
},
19-
},
20-
],
21-
},
22-
},
23-
},
24-
},
25-
"config-sync": {
26-
enabled: true,
27-
config: {
28-
syncDir: "config/sync/",
29-
minify: false,
30-
soft: false,
31-
importOnBootstrap: env("NODE_ENV") !== "development",
32-
customTypes: [],
33-
excludedTypes: [],
34-
excludedConfig: [],
35-
},
36-
},
5+
menus: {
6+
config: {
7+
layouts: {
8+
menuItem: {
9+
link: [
10+
{
11+
input: {
12+
label: "Page Relation",
13+
name: "page_relation",
14+
type: "relation",
15+
},
16+
grid: {
17+
col: 6,
18+
},
19+
},
20+
],
21+
},
22+
},
23+
},
24+
},
25+
"config-sync": {
26+
enabled: true,
27+
config: {
28+
syncDir: "config/sync/",
29+
minify: false,
30+
soft: false,
31+
importOnBootstrap: env("NODE_ENV") !== "development",
32+
customTypes: [],
33+
excludedTypes: [],
34+
excludedConfig: [],
35+
},
36+
},
3737
});

cms/config/server.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export default ({ env }) => ({
2-
host: env('HOST', '0.0.0.0'),
3-
port: env.int('PORT', 1337),
4-
app: {
5-
keys: env.array('APP_KEYS'),
6-
},
7-
webhooks: {
8-
populateRelations: env.bool('WEBHOOKS_POPULATE_RELATIONS', false),
9-
},
2+
host: env("HOST", "0.0.0.0"),
3+
port: env.int("PORT", 1337),
4+
app: {
5+
keys: env.array("APP_KEYS"),
6+
},
7+
webhooks: {
8+
populateRelations: env.bool("WEBHOOKS_POPULATE_RELATIONS", false),
9+
},
1010
});
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
'use strict';
1+
"use strict";
22

33
/* eslint-disable no-unused-vars */
44
module.exports = (config, webpack) => {
5-
// Note: we provide webpack above so you should not `require` it
6-
// Perform customizations to webpack config
7-
// Important: return the modified config
8-
return config;
5+
// Note: we provide webpack above so you should not `require` it
6+
// Perform customizations to webpack config
7+
// Important: return the modified config
8+
return config;
99
};

cms/src/api/newspost/controllers/newspost.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
* newspost controller
33
*/
44

5-
import { factories } from '@strapi/strapi'
5+
import { factories } from "@strapi/strapi";
66

7-
export default factories.createCoreController('api::newspost.newspost');
7+
export default factories.createCoreController("api::newspost.newspost");

cms/src/api/newspost/routes/newspost.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
* newspost router
33
*/
44

5-
import { factories } from '@strapi/strapi';
5+
import { factories } from "@strapi/strapi";
66

7-
export default factories.createCoreRouter('api::newspost.newspost');
7+
export default factories.createCoreRouter("api::newspost.newspost");

cms/src/api/newspost/services/newspost.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
* newspost service
33
*/
44

5-
import { factories } from '@strapi/strapi';
5+
import { factories } from "@strapi/strapi";
66

7-
export default factories.createCoreService('api::newspost.newspost');
7+
export default factories.createCoreService("api::newspost.newspost");

0 commit comments

Comments
 (0)