Skip to content
This repository was archived by the owner on Dec 3, 2021. It is now read-only.

Commit 79853e6

Browse files
committed
refactor: add c- prefix to all classes
1 parent 8c13f07 commit 79853e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+20257
-21033
lines changed

.eslintrc.json

Lines changed: 47 additions & 225 deletions
Original file line numberDiff line numberDiff line change
@@ -1,235 +1,57 @@
11
{
22
"root": true,
33
"parser": "babel-eslint",
4-
"env": {
5-
"browser": true,
6-
"es6": true
7-
},
8-
"extends": "eslint:recommended",
9-
"plugins": ["compat"],
4+
"extends": [
5+
"plugin:import/errors",
6+
"plugin:import/warnings",
7+
"plugin:unicorn/recommended",
8+
"xo/esnext",
9+
"xo/browser"
10+
],
1011
"rules": {
11-
// Possible Errors
12-
"no-await-in-loop": "error",
13-
"no-extra-parens": "error",
14-
"no-prototype-builtins": "error",
15-
"no-template-curly-in-string": "error",
16-
"compat/compat": "error",
17-
"valid-jsdoc": "error",
18-
19-
// Best Practices
20-
"accessor-pairs": "error",
21-
"array-callback-return": "error",
22-
"block-scoped-var": "error",
23-
"class-methods-use-this": "off",
24-
"complexity": "error",
25-
"consistent-return": "error",
26-
"curly": "error",
27-
"default-case": "error",
28-
"dot-location": ["error", "property"],
29-
"dot-notation": "error",
30-
"eqeqeq": "error",
31-
"guard-for-in": "error",
32-
"no-alert": "error",
33-
"no-caller": "error",
34-
"no-div-regex": "error",
35-
"no-else-return": "error",
36-
"no-empty-function": "error",
37-
"no-eq-null": "error",
38-
"no-eval": "error",
39-
"no-extend-native": "error",
40-
"no-extra-bind": "error",
41-
"no-extra-label": "error",
42-
"no-floating-decimal": "error",
43-
"no-implicit-coercion": "error",
44-
"no-implicit-globals": "error",
45-
"no-implied-eval": "error",
46-
"no-invalid-this": "off",
47-
"no-iterator": "error",
48-
"no-labels": "error",
49-
"no-lone-blocks": "error",
50-
"no-loop-func": "error",
51-
"no-magic-numbers": ["error", {
52-
"ignore": [-1, 0, 1],
53-
"ignoreArrayIndexes": true
12+
"capitalized-comments": "off",
13+
"indent": [
14+
"error",
15+
2,
16+
{
17+
"MemberExpression": "off",
18+
"SwitchCase": 1
5419
}
5520
],
56-
"no-multi-spaces": ["error", {
57-
"ignoreEOLComments": true,
58-
"exceptions": {
59-
"AssignmentExpression": true,
60-
"ArrowFunctionExpression": true,
61-
"CallExpression": true,
62-
"VariableDeclarator": true
63-
}
64-
}
21+
"max-params": [
22+
"warn",
23+
5
6524
],
66-
"no-multi-str": "error",
67-
"no-new": "error",
68-
"no-new-func": "error",
69-
"no-new-wrappers": "error",
70-
"no-octal-escape": "error",
71-
"no-param-reassign": "off",
72-
"no-proto": "error",
73-
"no-restricted-properties": "error",
74-
"no-return-assign": "error",
75-
"no-return-await": "error",
76-
"no-script-url": "error",
77-
"no-self-compare": "error",
78-
"no-sequences": "error",
79-
"no-throw-literal": "error",
80-
"no-unmodified-loop-condition": "error",
81-
"no-unused-expressions": "error",
82-
"no-useless-call": "error",
83-
"no-useless-concat": "error",
84-
"no-useless-return": "error",
85-
"no-void": "error",
86-
"no-warning-comments": "off",
87-
"no-with": "error",
88-
"prefer-promise-reject-errors": "error",
89-
"radix": "error",
90-
"require-await": "error",
91-
"vars-on-top": "error",
92-
"wrap-iife": "error",
93-
"yoda": "error",
94-
95-
// Strict Mode
96-
"strict": "error",
97-
98-
// Variables
99-
"init-declarations": "off",
100-
"no-catch-shadow": "error",
101-
"no-label-var": "error",
102-
"no-restricted-globals": "error",
103-
"no-shadow": "off",
104-
"no-shadow-restricted-names": "error",
105-
"no-undef-init": "error",
106-
"no-undefined": "error",
107-
"no-use-before-define": "off",
108-
109-
// Node.js and CommonJS
110-
"callback-return": "off",
111-
"global-require": "error",
112-
"handle-callback-err": "error",
113-
"no-mixed-requires": "error",
114-
"no-new-require": "error",
115-
"no-path-concat": "error",
116-
"no-process-env": "error",
117-
"no-process-exit": "error",
118-
"no-restricted-modules": "error",
119-
"no-sync": "error",
120-
121-
// Stylistic Issues
122-
"array-bracket-spacing": "error",
123-
"block-spacing": "error",
124-
"brace-style": "error",
125-
"camelcase": "error",
126-
"capitalized-comments": "off",
127-
"comma-dangle": "error",
128-
"comma-spacing": "error",
129-
"comma-style": "error",
130-
"computed-property-spacing": "error",
131-
"consistent-this": "error",
132-
"eol-last": "error",
133-
"func-call-spacing": "error",
134-
"func-name-matching": "error",
135-
"func-names": "off",
136-
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
137-
"id-blacklist": "error",
138-
"id-length": "off",
139-
"id-match": "error",
140-
"indent": ["error", 2, { "SwitchCase": 1 }],
141-
"jsx-quotes": "error",
142-
"key-spacing": "off",
143-
"keyword-spacing": "error",
144-
"linebreak-style": ["error", "unix"],
145-
"line-comment-position": "off",
146-
"lines-around-comment": "off",
147-
"lines-around-directive": "error",
148-
"max-depth": ["error", 10],
149-
"max-len": "off",
150-
"max-lines": "off",
151-
"max-nested-callbacks": "error",
152-
"max-params": "off",
153-
"max-statements": "off",
154-
"max-statements-per-line": "error",
155-
"multiline-ternary": "off",
156-
"new-cap": ["error", { "capIsNewExceptionPattern": "$.*" }],
157-
"newline-after-var": "off",
158-
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 5 }],
159-
"new-parens": "error",
160-
"no-array-constructor": "error",
161-
"no-bitwise": "error",
162-
"no-continue": "off",
163-
"no-inline-comments": "off",
164-
"no-lonely-if": "error",
25+
"multiline-ternary": [
26+
"error",
27+
"always-multiline"
28+
],
29+
"new-cap": "off",
16530
"no-mixed-operators": "off",
166-
"no-multi-assign": "error",
167-
"no-multiple-empty-lines": "error",
168-
"nonblock-statement-body-position": "error",
169-
"no-negated-condition": "off",
170-
"no-nested-ternary": "error",
171-
"no-new-object": "error",
172-
"no-plusplus": "off",
173-
"no-restricted-syntax": "error",
174-
"no-tabs": "error",
175-
"no-ternary": "off",
176-
"no-trailing-spaces": "error",
177-
"no-underscore-dangle": "off",
178-
"no-unneeded-ternary": "error",
179-
"no-whitespace-before-property": "error",
180-
"object-curly-newline": ["error", { "minProperties": 1 }],
181-
"object-curly-spacing": ["error", "always"],
182-
"object-property-newline": "error",
183-
"one-var": ["error", "never"],
184-
"one-var-declaration-per-line": "error",
185-
"operator-assignment": "error",
186-
"operator-linebreak": "error",
187-
"padded-blocks": ["error", "never"],
188-
"padding-line-between-statements": "off",
189-
"quote-props": ["error", "as-needed"],
190-
"quotes": ["error", "single"],
191-
"require-jsdoc": "off",
192-
"semi": ["error", "never"],
193-
"semi-spacing": "error",
194-
"sort-keys": "off",
195-
"sort-vars": "error",
196-
"space-before-blocks": "error",
197-
"space-before-function-paren": ["error", {
198-
"anonymous": "always",
199-
"named": "never"
200-
}],
201-
"space-in-parens": "error",
202-
"space-infix-ops": "error",
203-
"space-unary-ops": "error",
204-
"spaced-comment": "error",
205-
"template-tag-spacing": "error",
206-
"unicode-bom": "error",
207-
"wrap-regex": "off",
208-
209-
// ECMAScript 6
210-
"arrow-body-style": ["error", "as-needed"],
211-
"arrow-parens": "error",
212-
"arrow-spacing": "error",
213-
"generator-star-spacing": "error",
214-
"no-confusing-arrow": "error",
215-
"no-duplicate-imports": "error",
216-
"no-restricted-imports": "error",
217-
"no-useless-computed-key": "error",
218-
"no-useless-constructor": "error",
219-
"no-useless-rename": "error",
220-
"no-var": "error",
221-
"object-shorthand": "error",
222-
"prefer-arrow-callback": "error",
223-
"prefer-const": "error",
224-
"prefer-destructuring": "off",
225-
"prefer-numeric-literals": "error",
226-
"prefer-rest-params": "error",
227-
"prefer-spread": "error",
228-
"prefer-template": "error",
229-
"rest-spread-spacing": "error",
230-
"sort-imports": "error",
231-
"symbol-description": "error",
232-
"template-curly-spacing": "error",
233-
"yield-star-spacing": "error"
31+
"object-curly-spacing": [
32+
"error",
33+
"always"
34+
],
35+
"prefer-destructuring": [
36+
"error",
37+
{
38+
"object": true,
39+
"array": false
40+
}
41+
],
42+
"semi": [
43+
"error",
44+
"never"
45+
],
46+
"unicorn/explicit-length-check": "off",
47+
"unicorn/filename-case": "off",
48+
"unicorn/import-index": "off",
49+
"unicorn/no-unused-properties": "error",
50+
"unicorn/prefer-includes": "off",
51+
"unicorn/prefer-node-append": "off",
52+
"unicorn/prefer-node-remove": "off",
53+
"unicorn/prefer-query-selector": "off",
54+
"unicorn/prefer-text-content": "off",
55+
"unicorn/prevent-abbreviations": "off"
23456
}
23557
}

build/css-classes-migration.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env node
2-
/* eslint-disable arrow-parens */
32
'use strict'
43

54
/* global Set */
@@ -11,7 +10,8 @@ const { join } = require('path')
1110
const sh = require('shelljs')
1211
// sh.config.fatal = true
1312
const sed = sh.sed
14-
const replace = fs.readFileSync('css_prefix_migration.json')
13+
const classesWithPrefix = fs.readFileSync('node_modules/@coreui/coreui/migration/css_prefix_migration.json')
14+
const newCSSClasses = fs.readFileSync('node_modules/@coreui/coreui/migration/css_new_classes.json')
1515

1616
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
1717
RegExp.quote = (string) => string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
@@ -116,7 +116,7 @@ function findDataAttributes(filepath, allowedDataAttributes, classes) {
116116

117117
function main(args) {
118118
const directory = args[0]
119-
const newClasses = JSON.parse(replace).replace
119+
const newClasses = Object.assign(JSON.parse(classesWithPrefix).replace, JSON.parse(newCSSClasses).replace)
120120
// const EXCLUDED_DIRS = new Set([
121121
// '.git',
122122
// 'node_modules',

0 commit comments

Comments
 (0)