Skip to content

Commit a633ce9

Browse files
committed
Fix lint
1 parent 8cf2a63 commit a633ce9

File tree

3 files changed

+40
-40
lines changed

3 files changed

+40
-40
lines changed

src/@types/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export type RTLCSSPlugin = {
4343
name: string;
4444
priority: number;
4545
directives: {
46-
control: Object,
47-
value: Array<Object>
46+
control: object,
47+
value: Array<object>
4848
};
4949
}
5050

src/data/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const isNotAcceptedStringMap = (stringMap: PluginStringMap[]): boolean => {
106106
const isAcceptedProcessDeclarationPlugins = (plugins: DeclarationPlugin[]): boolean =>
107107
Array.isArray(plugins)
108108
&& plugins.every((plugin: DeclarationPlugin) =>
109-
typeof plugin.name == STRING_TYPE
109+
typeof plugin.name == STRING_TYPE
110110
&& typeof plugin.priority == NUMBER_TYPE
111111
&& Array.isArray(plugin.processors)
112112
&& plugin.processors.every((processor: DeclarationPluginProcessor) =>
Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
import postcss from 'postcss';
22
import postcssRTLCSS from '../src';
3-
import { PluginOptions, Mode } from '../src/@types';
3+
import {PluginOptions} from '../src/@types';
44
import {
5-
readCSSFile,
6-
runTests,
7-
createSnapshotFileName
5+
readCSSFile,
6+
runTests,
7+
createSnapshotFileName
88
} from './utils';
99
import 'jest-specific-snapshot';
1010

1111
const BASE_NAME = 'process-declaration-plugins';
1212

1313
runTests({}, (pluginOptions: PluginOptions): void => {
1414

15-
describe(`[[Mode: ${pluginOptions.mode}]]`, (): void => {
15+
describe(`[[Mode: ${pluginOptions.mode}]]`, (): void => {
1616

17-
let input = '';
18-
19-
beforeEach(async (): Promise<void> => {
20-
input = input || await readCSSFile(`input-${BASE_NAME}.scss`);
21-
});
22-
23-
it('flip background by default', (): void => {
24-
const output = postcss([postcssRTLCSS(pluginOptions)]).process(input);
25-
expect(output.css).toMatchSpecificSnapshot(
26-
createSnapshotFileName(BASE_NAME,'flip', pluginOptions.mode)
27-
);
28-
expect(output.warnings()).toHaveLength(0);
29-
});
17+
let input = '';
18+
19+
beforeEach(async (): Promise<void> => {
20+
input = input || await readCSSFile(`input-${BASE_NAME}.scss`);
21+
});
22+
23+
it('flip background by default', (): void => {
24+
const output = postcss([postcssRTLCSS(pluginOptions)]).process(input);
25+
expect(output.css).toMatchSpecificSnapshot(
26+
createSnapshotFileName(BASE_NAME, 'flip', pluginOptions.mode)
27+
);
28+
expect(output.warnings()).toHaveLength(0);
29+
});
30+
31+
it('use {processDeclarationPlugins} to avoid flipping background', (): void => {
32+
const options: PluginOptions = {
33+
...pluginOptions,
34+
processDeclarationPlugins: [{
35+
name: 'avoid-flipping-background',
36+
priority: 99, // above the core RTLCSS plugin which has a priority value of 100
37+
processors: [{
38+
expr: /(background|object)(-position(-x)?|-image)?$/i,
39+
action: (prop: string, value: string) => ({prop, value})
40+
}]
41+
}]
42+
};
43+
const output = postcss([postcssRTLCSS(options)]).process(input);
44+
expect(output.css).toMatchSpecificSnapshot(
45+
createSnapshotFileName(BASE_NAME, 'noflip', pluginOptions.mode)
46+
);
47+
expect(output.warnings()).toHaveLength(0);
48+
});
3049

31-
it('use {processDeclarationPlugins} to avoid flipping background', (): void => {
32-
const options: PluginOptions = {
33-
...pluginOptions,
34-
processDeclarationPlugins: [{
35-
name: 'avoid-flipping-background',
36-
priority: 99, // above the core RTLCSS plugin which has a priority value of 100
37-
processors: [{
38-
expr: /(background|object)(-position(-x)?|-image)?$/i,
39-
action: (prop: string, value: string) => ({prop, value})
40-
}]
41-
}]
42-
};
43-
const output = postcss([postcssRTLCSS(options)]).process(input);
44-
expect(output.css).toMatchSpecificSnapshot(
45-
createSnapshotFileName(BASE_NAME,'noflip', pluginOptions.mode)
46-
);
47-
expect(output.warnings()).toHaveLength(0);
4850
});
49-
50-
});
5151

5252
});

0 commit comments

Comments
 (0)